Handle some invalid repo edge cases

I've been testing with some repos checked out in a subdirectory of my
local Twig clone, and one edge case I've experimented with is having an
empty directory as a sibling of the other directories. For example:

  twig.git/                    <-- local Twig clone
  twig.git/repos/project1      <-- a Git repo
  twig.git/repos/project2      <-- another Git repo
  twig.git/repos/dud           <-- bogus, non-Git directory

Because of the way Git will walk up the file system looking for a valid
repo, commands such as `git log` run inside `twig.git/repos/dud`
actually work, but they reference `twig.git`.

This commit handles that edge case, and others, by ensuring that when we
look at a given repo `a/b/c`, that path points at an existing directory
which is a valid git repo, and furthermore is the top level of that
repo.

Note that we use `git rev-parse --show-prefix` to perform this check
because it works on both bare and non-bare repos (other options to
`git rev-parse`, such as `--show-toplevel`, don't work properly on bare
repos).

The desired behavior, at least for now, is to quietly ignore bad
directories.

Change-Id: Ie5a6fde64d930c60f22dc1aba5bfade7f934c8fa
Reviewed-on: https://gerrit.causes.com/24884
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Use Pathname#basename to extract repo name

This isolates us from platform-specific details like whether "/" is
actually a path separator or not; I believe that Pathname will render
path separators as slashes even on Windows, but there is no guarantee
that that will always be the case so we might as well be future-proof.

As a bonus, the code is shorter and arguably more intention-revealing.

Change-Id: I6a81fc8aff73b1982466c614e359364c49f01ca7
Reviewed-on: https://gerrit.causes.com/24885
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Move commit-stats -> twig-stats

This is in further preparation for gemmification; our binaries will get
installed in the PATH along with whatever else might be in there, so we
need something in the name to differentiate them.

For now that means `twig-app` and `twig-stats`, although I'd like to
turn these into subcommands of a single `twig` executable as a
subsequent step.

This commit renames `commit-stats` to `twig-stats` and updates the
references in the doc accordingly. I've already dropped the `bin/`
prefixes from the names, as they won't be needed any more once this is a
gem.

Change-Id: Iad48ea5babd80702f7c52322689ffb21851f5767
Reviewed-on: https://gerrit.causes.com/24886
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>