Avoid repeated SQL lookups for current_state whilst looping through each possible event
Merge pull request #76 from pacso/master

Avoid repeated SQL lookups for current_state