support of global compilation mode on top of commonJS

Closes #219