Dusted off the code to make the tests pass again

Here's a first pass at getting the tests to pass again. Note that a lot of the line changes are due to go formatting.