Remove ElasticSearch global, pass it as argument

I think it could be done more nicely.. But it seems to work.
I'm not so certain about how to deal with the es object in the tests. This is just a simple solution to not have to change too much. If anyone more famaliar with the test structure has a better idea that would be fine.