Fixed a few major bugs, added tests for them.  Adding files that hadn't made it into Git.