Support for .foo(Function) and testing. TODO: More tests