clarify and clean up handling of optional functions in the API.  fixes #46.