ModuleCompiler separate back (php)/frontend (js)

separated frontend and backend processing. some other minor changes.