Add some basic documentation, and remove some long-obsolete functions.