Add a (failing) test for key serialization
Improve pretty-printing of key sets
Fix serialization of keys.

All tests pass again.