Major organizational refactor; break everything out into separate files