Add countP and countByP functions and some more tests - including to these [...]

Also, update the version (0.0.9).