Fix elastic search check

* Make check working on python 2.4
* Make check working on ES version 0.90.12 and higher (but lower than
1.0.0)
* Have proper behavior on newer versions of ES
* Remove unused code