Updated doc comments and reorganized some of the internal code for the class.