Complete overhaul of git prompt function

This uses the output of ``git status -z --porcelain'', which was
designed for exactly this kind of reason. It avoids excessive program
calls, forks, and a few subshells, and is consistently faster on
everything I've tried so far.