A few updates to the code

Hey, long time no check-in ;) Sorry I haven't been responsive, life has been busy. I had need for the library at work again, which gave me an excuse to hack on the code a little bit more. 

Any rate, I bundled the changes I made to the code into 5 commits that should be able to be pulled independently of one another. Let me know if you have any questions, it is about midnight localtime, so if I have time tomorrow I may try to go through and add some line comments.