[refactor] let PubHub-constructor accept an object rather than a db