Collect active substates before sending events to them.
Merge pull request #5 from confucious/master

Collect active substates before sending events to them.