Live two-way synchronization of local javascript objects with a remote database