Cleanup per PR comments.

* Move methods into classes rather than 'testing' file
* Add RDoc comments
* Expand/reformat tests