Make sure all asynchronous operations have finished before returning from flush.
Move api functions to wrap, update references.
Move cluster initialization to cluster.py.
Patching up tests.
Fixing references to setitem, etc.