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

I thought about adding a functional test too, but it seemed unnecessary since there's already functional testing of GearClient.add with environment supplied.

This branch does make me think that I went OTT with the GearEnvironment class. It seems unnecessary unless we ever support the shared environment features of gear.

Perhaps I should simplify it now.

Fixes #586