Providing two-way data bindings between an object and a DOM element