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.

WIP: still needs handling for docs specified using bson.D and bson.M,
and documentation.