Make tests pass

WIP for fixing compiler warnings and making Go tests pass.

I left in most of the original logging statements, but we'll want to take those out. I also didn't do much to clean up code that wasn't necessary to change in order to get the tests to pass.