Separate read and write DOM phases in update loop