Add isArray and keys, and make copy handle deep copying