Added karma tests and coverage, and "uglify" minification

Also, used clearer var names in initHandlers function