core: refacored zotonic_compile a little bit more.