Refactor directory structure and add submodules