Document, clean up, and add go testing