Protocol 4 support added.

This started as "make bravo work with 1.7" and turned into "clean up bravo enough to make it posible to make bravo work wtih 1.7", so the changes are somewhat conflated.

It does work -- even partially supports encryption -- and almost all tests still pass.