Finishing API documentation and some minor refactoring/cleanup
Resolves #4