Convert eventRegistry to a go generate'd file.

This reduces the amount of copy-pasta and removes the risk of copy-paste error.
It uses reflect instead of parsing with go/parser, so it looses the function
argument names. This may be fixed in a follow up.