Make PbD testable, and write first tests.