Fixing and simplifying the API.

- Fixing a problem where Python was converting API functions into
  unbound methods, even when added outside of class creation.
- Making it easier on API extensions to just return normal data types if
  they want, and automatically wrapping in a json http response.
- Minor simplifications to variable names.