Fix event state bug. Add onenter and onleave shorthands. Make auto initializing.