Add documentation for creating and firing custom events. See issue #982.