magit-list-{refs,refnames,{*}branch{*}}: new functions
magit-get-ref: rename argument REF to NAME
magit-get-refname: new function
magit-get-shortname: new function, replacing magit-name-rev
magit-unambiguous-refname-p: new function

This replaces `magit-ref-ambiguous-p'; the input isn't
necessarily a ref and we should assert "the good case".
magit-rev-parse: accept any number of arguments
magit-rev-parse-p: new function
magit-list-interesting-refs: remove function and related crap

Instead use the recently added `magit-list-refnames'.

This is (only) the starting point to implement more meaningful revision
and reference completion.  `magit-list-interesting-refs' was very very
bad.  Basically it and the code which surrounded it (not all of which
has been replaced yet) took the "when in doubt, pick the worst possible
option" approach.  E.g. instead of asking "what do we have to complete?"
and answering that with (in nine out of ten cases) "branches", and then
going on to "how do we get a list of branches?"; what we actually did
was "find some git command that gives us a list of refs, pick the first
one, it doesn't matter whether there are better ones", then start using
it, notice that the completion candidates contain many refs that we are
not interested in, implement "filter out the uninteresting refs", and
then keep on complicating things, making it less and less likely that
this will ever be fixed.  Well, I have had it, this crap has to go.
Merge branch 'n/refs-1' into next
magit-stash-snapshot: keep index staged

This means using `--index' when applying,
*not* using `--keep-index' when staging.