Split functions.sh into two parts

It's nice to create functions based on whether certain tools exists, but
you want to do that after the PATH has been setup.  This does that and a
few other small cleanups.