AMD support

...and some jshint stuff