Minimal style fixes and typedefs to pass through gjslint and Google Closure Compiler on ADVANCED level