Use custom attribute handler for 'value' and 'checked'.

Setting these attribute on DOM elements only affects their initial
state. Instead, one should set the JavaScript property on the
DOM element directly.

Fixes #1752