Reformat javascript objects easily