Adds simple functional test for indices.flush().
Adds simple functional test for indices.optimize().