Fix for state propagation related to starting of new workflow cycle

Hi Dan:

This fixes issue related to calling signal handler for state changes. This includes listeners for generating
email notification.

Also did cleanup of db.session query and use SQLAlchemy model object fields

Regards
Mouli