Refactor some more things into apps; Broke a lot of tests in the process
Fix tests