Restructured code to use browserify