Improved documentation, minor code cleanup, and new factory methods.