Documented public classes and functions. Some minor code tweaks.