Tests, purpose statements, and various minor improvements.