Whitespace improvements for readability; conform to jshint.

I've fixed some inconsistent indentation and spacing as well as made statechart.js conform to most of the default jshint recommendations. There weren't very many functional changes at all, and tests pass.