Add event utilities (including a tiny wrapper around EventEmitter)
Update states to use the new event infrastructure