Implements upserts.
Merge pull request #7 from vladlosev/feat-update-upsert

Implements upserts.