RequireJS it all
Some cleaning up of jshint issues.
Some more code complexity changes. Abstract some stuff out, and an undefined check.
Merge pull request #200 from YaManicKill/requirejs

Requirejs stuff