Nicer auto tests

Basically a nice refactoring. Not complete, but a good step forward in terms of a cleaner API, but most of doing that was so I had test times in the view. In general, this should make automated testing easier to clean up and extend.