Added a bit more polish!

This is still a rough implementation of everything. I'm getting
features working, but the code is definitely sloppy and needs serious
cleaning up before I go much further.