Added wait writes after each recovering batch. Added randomizing to test_index.py