Cleanup all code for consistency, and clarity.

I'm not opposed to these types of changes but they aren't typically required when minification is done. Variable declarations are usually aggregatted to moved to the top of the scope. But I do agree this is more about "best practices" than anything.