Retain key order when copying objects

This is a necessary fix for an issue in Mongodb 2.4.4 where the order of
the $each operator matters when used with $push