Use native Array.isArray() instead of "instanceof Array"

Parts of the code base where still using instanceof Array. Switched all the found cases to Array.isArray() which is faster for v8 and instanceof Array only checks to left hand inheritance chain to see if the object was made with the Array constructor, this could cause failure in edge cases and when used with the vm module.