Various tweaks to documentation to get haddock happy.  Refactors for clarity.