q for CommonJS

I had a problem with the existing q declaration. While it worked great with browsers where no module loading was used, it was not so useful in an environment using CommonJS or AMD style module loading. So I copied the file to a new folder (qcommon) and modified it so that it exported functions directly to the q module rather than as a separate interface with a static declaration.