Fix up some mess that was introduced when adding the elasticsearch_flask extension, as well as some more mess from using an old version of the
elasticsearch python module that isn't meant to be used with our version of elasticsearch.

Needs more cleaning