minimal gen util that works in the browser too
add transparent browserify support
old code
0.3.21