Update util.js

minor optimization over `isPrimitive` and `isArray` plus added `isNaN` for module purpose consistency.