Allowing a factory method to be undefined

If the factory method is undefined assume that factory is the function in itself, an example of this is express 3.0