check state duration and some fixes around previous_state, may fix #258
minor tweaks missed in last commit
move state duration calc from email.rb to processor.rb
Merge pull request #290 from ali-graham/258_email_tweaks

duration in emails, various processor & filter tweaks