Add update_value_direct() javascript helper

The update_value() function cannot be passed directly a value: the value
needs to be fetched from an HTML component. There are some cases where
we might want to pass a value directly. So split update_value() code
into a update_value_direct() helper, and the code wrapping it.
Merge pull request #552 from vuntz/update_value_direct

Add update_value_direct() javascript helper