huge refactor to real browserify