Implementing commit()

Mainly addressing #59, but touching on other issues along the way.

- Fixed #58
- Fixed #62
- Addressed #39

See commit comments for full change log.