Pass the supplied Application environment during StartApplication state changes - fixes 586

Fixes #586