Add a set method and change update to perform non-destrutive updates. Fixes #4