Add support for multiple event patterns.

@mulby This was a prerequisite for doing further work on synthetic events.   I'm pulling it out into a separate PR.