updated to work with new gaffa and browserify