node and browser compatible

create module and made change for compatibility for both browsers and
node.
removed dependency of Tolerance color function