Merge some of update by document and script

These share many of the same options so it makes sense to merge them.
This also adds support for things like _retry_on_conflict and _routing to
updates by scripts.

Closes #628
Closes #627
Merge pull request #629 from nik9000/retry_bulk_script

Merge some of update by document and script