Fix 'undefined module' error in lib/browser.js

Browsers complain when lib/browser.js is included, because `module` is undefined. Add type checking to resolve this.
Merge pull request #115 from nicholaswyoung/master

Fix 'undefined module' error in lib/browser.js