Fix tests

This pull request aims at fixing the test suit and making it less brittle. The following is a list of the changes and todo list

1. [x] Add api to tell when the cluster is in sync
2. [x] Remove all sleeps from the tests
2. [x] Group all data tests in data_test.go with a convention of splitting initialization phase and test phase
3. [ ] run the tests in a cluster as well as standalone server
3. [x] some tests are still failing, fix them
4. [ ] Move the coordinator test suite to the integration test suite
5. [x] Merge the engine test suite in data_test.go