Break out everything into modules
Fix accidental code dupe
Fix a couple import issues