How to prep a javascript module for node and browser