Allow a function to be sent as the callbackURL

This lets apps which are accessible from multiple domain names dynamically
select the callback based on some criteria available in the request.