Refactor

![55226-let-me-play-you-the-song-of-my-92w3](https://cloud.githubusercontent.com/assets/180050/2665138/dc6e9914-c089-11e3-8603-c2b21ffa1d05.gif)

I did some refactoring (see git commits for the gory details). I ran out of time so couldn't continue, but this should suffice for now.

Feel free to ignore this PR if you aren't interested :-)