add support for downloading branches other than master

This is backwards-compatible with the current API.

Another way to implement this would be to support an optional branch fragment in the shorthand repo string, like `user/repo#branch`, but I'm not sure...

Thoughts, @ianstormtaylor?