Adds `withUpdate` to widget.js

This adds a transaction-like update to widgets.