Cleanup and support for retrieving bug comments

I wanted to add an API for retrieving bug comments. This is accomplished in the final commit of this pull request.

Before I got there, I did a little refactoring to reduce boilerplate. This should lower the barrier to extending the API in the future.