>Does anybody happen to know if PHP offers some means for
>calling external routines (from a user supplied library)?
Yes.
See: http://www.php3.net/manual/
Chase the links to "dynamic loading".
Now, this will be fun to port. :-) (If someone undertakes
the challenge, I'll provide the dynamic loading stuff I
did for Perl and Java).