tabs to spaces
modularized code for node and browser