Update with some minor formatting changes in the source, as well as some comments.

There are some unit tests in the standalone subdirectory.