Lots of small documentation fixes and removal of unused constants, etc.