Refactored code to use browserify/watchify