Implement the javascript compiler, refactor module structure