Revising commonjs module framework to bring it more in line with PhantomJs