Protocol version is now integer, add some more logging, some test refactoring