set values in javascript objects by specifying a path