Updated implementation from AMD to CommonJS using browserify