Further documentation, and some unused code deletion.