AsFunction added to simplify functional conversions

https://github.com/kfgodel/diamond/issues/119