First batch of changes towards CommonJS modularization