shoddy attempt at emulating module.exports in the browser (should use browserify)