I found out some more PAM stuff, including a detailed description of how each of the PAM modules behaves, here:
The PAM System Administrator’s Guide
That would have saved me some time before 🙂
There is also the PAM application developers guide, with details on how best to write applications which use PAM for password authentification.
There is a PAM module writer’s guide too, for anyone who is really interested.