Test that file exists before trying to grep
Make node global dir early

Don't want for npm install or npm commands will write a debug log.
Ensure custom PATH dirs always go to end

Doing 'exec zsh' on a mac puts all the system dirs back at the front
and mine wouldn't get re-added.
Homebrew a few essential utilities
Make terminfo detection more cross-platform

for bsd/darwin