I looked at shallowCopy, but since it doesn't support arrays I didn't use it.

I haven't thought much about `$`-prefixed properties. I'm not sure why they should be excluded in this case. Do you have some opinions on that?