Fixing browser-side error 'module is not defined'

exports / module.exports are undefined browser-side (as suggested in the comment on line 15) is used only server-side, 
so it breaks browser-side implementations to assign them without checking if they exist first.