Project restructure, refactor and more

See commit messages for detailed changes