Use more standard git rev-parse command to check if in a git tree,
cosmetic cleanups.