(#1021) use browserify to insert globals, but working
merge with most recent master