random suggestions for js style

a bunch of little js style changes I think make code a little easier to read. some of it's stuff that my company prefers, like grouping together assignments when reasonable, and some of it's stuff that [syntastic](https://github.com/scrooloose/syntastic) points out to me, like putting semicolons after every statement.

leave comments on the diff if there's anything you disagree with or feel free to merge it if there isn't. None of these changes should change the functionality at all.