Add code + a few extra comments from the scalar UDF examples in the
docs. Didn't do extra testing, just reused the code straight from
the docs with 2-space indentation.