Code cleanup - first pass
Code cleanup - second pass
Made code more readable
Revert comment changes, breaking current hacky apidoc-generation
Regenerate doc/api.md