Implement keybag(), so that at least KeyBag.perl can roundtrip