improving the custom pdoc task

* pygments is optional, but omitting it results in no syntax highlighting
  which is a huge step backwards. Pinning both pdoc and pygments to the
  build dependencies leads to a better out-of-the-box experience when
  generating html documentation.

* Checking the pdoc installation with an import, but then using the
  pdoc script was an unnecessary discrepancy. The installation check
  now verifies that the script is present and looks good instead.