Major refactor, lots of moved files and changed headers