Fixed untracked file problem with newer versions of git

Code previously detected untracked files in git by looking for the
string "# Untracked". Now uses `git status --porcelain` and looks for
an initial " ??". This should be more robust against future changes to
git.