Cleanded up utility a bit and added type exports to kafak_protocol.