Added some documentation to the utility functions and
cleaned up some issues caught but golint and formatting.