Use safer isArray

`object instanceof Array` is not safe in multi-frame environments. See http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/ for more information.
Merge pull request #8 from mjackson/safe-array

Use safer isArray