Add support for function pointers and add a unit test