Invert a javascript-object