// http://stackoverflow.com/a/10196772/173630
function allKeysToLowerCase(obj) {
var output = {};
for (i in obj) {
if (Object.prototype.toString.apply(obj[i]) === '[object Object]'
|| Object.prototype.toString.apply(obj[i]) === '[object Array]'
) {
output[i.toLowerCase()] = allKeysToLowerCase(obj[i]);
} else {
output[i.toLowerCase()] = obj[i];
}
}
return output;
}