Second half of the massive refactor for 0.5. Everything is basically functional, although a lot of refinement to go