Fixing and simplifying the API.
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.

sideeffects/stats_core,sideeffects/stats_core,sideeffects/stats_core