First go at pbts

first pbts draft and a couple of changes to the main API