Support for Update API.

Fixes #250
"upsert" support in update API.
Tests for update API.
Merge pull request #274 from andreas/master

Initial support for update API