Move to CommonJS; Reorganize a lot of stuff