Extensive documentation additions and bug fixes.