Cleanup and adding some rdoc.