remove a bunch of unused js
jshinted some files and moved some globals to injected dependencies