allow handler modules to return an object instead of a function

If you follow the old example, each handler module returns a function that creates a class, instantiates the class and returns the object, which contains only static members.   This change gives you the option of returning a simple object instead.