changed code to use Array.isArray

this change is to more reliably detect an array argument. Previous code
produced a bug if the first item was a string, since strings also have a
length property
need to account for webpack and browserify

webpack and browserify make some node.js apis available in the browser.
This code was previously detecting node as the runtime when the actual
runtime was the browser.
Added compiled output

...and updated package.json to use compiled/src/index.js as main