[godzilla-sized-commit] Starting to refactor out functionality into seperate files, edited makefile accordingly