Allow python functions to be registered as ClassAd functions. #4598

Includes unit tests and documentation.