Finalized a lot of things so that they're more MVC ish. Also added a few
comments.