Adding a upsert function

Create element, check if it already exists and update it if so.
Silly js to coffee oversight
Merge pull request #2 from hugohil/patch-1

Adding a upsert function