add function copyObject

tank you marge!

my project need copy object.
so I add copyObject.
but this function may not match your concept...Xo

my english is not good.
If you're willing to merge if, it is nice to me and rewrite the comments function.