Clean up code, refactor class code out into class.go. Add documentation.