Enhancement for #88 - allow domain and range to be defined with an array as well as a function.