Add a unit test for Protocol
Lots of new tests