Fixed warning found by jshint
Fixed null error
Cleaned up code.
Added grunt config to buid all.min.js