Actually, I figured it out on my own, but for anyone who is interested:
For some reason, this line:
"google.visualization.events.addListener(categoryPicker,'statechange',onControlStateChange());" immediately calls onControlStateChange.
remove the () from it to fix it:
"google.visualization.events.addListener(categoryPicker,'statechange',onControlStateChange);"
For some reason, this works.