Rename functions for clarity.

These function names are easier to understand and document.
Document the new api.