Support Upserts to ElasticSearch

I've added a function to core.js to allow upserts into elastic search.
I'm not sure if this is the best way to do it, but I've added parameters for script, params and the document separately.
Hope this is helpful, any comments on it would be welcomed :)