Adds ability to use a function as datasource #28

Adds the ability to use a function as datasource. See ticket #28 for more information.