Move code to the src folder and refactor the code

Refactored to work without git submodules.