Perform deep copies of javascript objects