Add support for events syntax

This has no other effect besides parsing the syntax without an error.
This is a preliminary step towards support for systems.
Add support for system declaration syntax

This doesn't have any effect yet besides parsing the syntax. It is a
preliminary step towards support for systems.
Start adding support for systems

Please note that, although they are part of the API, Systems has no
notion of events yet. On calling trigger, all known systems will be
called.
Refactor
Only trigger system on its event
Group related type definitions