Massive restructure

General codebase house cleaning…