parse and generate twisted Perspective Broker protocol