improvements, fixes, test suite

 - fixed and improved some small things
 - added `unittest` test suite that covers 37% of the `pbp` module