add a functor function to d4.base which allows you to upcast variables to functions to make the api more uniform. This function is inspired by d3's function of the same name.