models.main: use "git config" instead of "git remote"

"git remote" output is technically porcelain which means that a future
Git version is allowed to change its output.

Use "git config" to get a list of remotes to future-proof us in
case the output ever changes.

Signed-off-by: David Aguilar <davvid@gmail.com>
core: rename instance() to current() to better reflect usage

The instance() methods return singletons.  Rename them to current() to
better reflect that they are the "current" instance.

Signed-off-by: David Aguilar <davvid@gmail.com>
browse: improve how we track directories

Store the "parent" directories entries by path rather than by id.  Use
defaultdict to simplify how we keep track of subdirectory counts.

Signed-off-by: David Aguilar <davvid@gmail.com>