function deepCopy(obj) {
    return JSON.parse(JSON.stringify(obj));
}
Deep copy an object

Firefox requires data to be serializable,
this removes everything offending such as functions

@since 3.0.0 moved to helpers.js 3.8.0

@param object obj an object to copy
@return object a new deep copy