Safer way of testing for Arrays and Functions

See http://web.mit.edu/jwalden/www/isArray.html