state: automatic multi-env handling for DB updates

Transaction operations that update collections that contain documents for multiple environments are now automatically updated to include the required environment specifiers.

(Review request: http://reviews.vapour.ws/r/605/)