Use elasticsearch#refresh instead of sleep

By default elasticsearch does not commit data to its index immediately.
Instead it is held in memory and periodically flushed to the index.

However it is possible to force the data to be in the index immediately
using a 'refresh' command[1,2].

[1]
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-refresh.html
[2]
http://www.rubydoc.info/gems/elasticsearch-api/Elasticsearch/API/Indices/Actions#refresh-instance_method
Merge pull request #12 from ministryofjustice/use-refresh-with-elasticsearch

Use elasticsearch#refresh instead of sleep
A helper method to enable html page titles
Page title: edit profile