add support for collections

In reference to issue #28 

This hasn't been tested in all scenarios - only one project - but it works in production in that scenario.