Fix bulk operations across models.
This is done by storing the bulk batch stack on the globally shared connection. This also adds support for nested bulk operations, since it builds up the stack.