Refactored project structure into multiple modules

See email for more details