Unify isArray/isFunction/toString implementations

Restores Array.isArray polyfill for all use cases.

Fixes #645