Async support for splitting batch inserts.
Refactored callbacks to make them non-static inner classes, since they talk an instance of the containing class anyway.