moved library over from Require to CommonJS