Ran through JSHint, partially through JSLint, still have to clean up more.