Some final cleanup

Various documentation and cleaning up of code