Simplify everything and fix browserify issues