Added tests to support the new func method. Implemented and exported.

Updated the README to include this as an API method and also an example