Factory function to define a knockout extender fro a given validator function.