Overhaul the internals.

We're going to have a better separation of responsibilities and a cleaner architecture. This lays the groundwork for future changes.

![2013-10-17 17 21 13](https://f.cloud.github.com/assets/297205/1361643/d1e367c0-380a-11e3-88b6-118f24818fbb.jpg)