Documentation and a bit of cleaning up.