move browserify compatability into lib/