restructured scripts slightly using browserify