Improved documentation; miscellaneous cleanup