Automatically initialise elasticsearch.

Charmstore will now automatically initialise elasticsearch when starting up.
This ensures that elasticsearch will always have the correct index and mapping
configuration required for correct operation.
A few comments might make this test logic easier to follow (and easier to understand what conditions are being tested for when we come to change the code later)