Centralize get_branches() in the SVN backends.

The get_branches() logic was pretty complicated, and existed in two
places. This change pulls it into SVNTool, and adds new client backend
functions for performing the directory listing operations.

This also simplifies get_branches(), since it was doing a bunch of work
to build new dictionaries out of old ones, which shouldn't be necessary
anymore.

Reviewed at https://reviews.reviewboard.org/r/5980/