Rewrite ViewFilter.parse()

The previous logic was about as concise as it could be, but as a
result there were a few subtle corner cases that were hard to follow.
Moreover, in general, we would like the logic for parsing the part
after /+cmd to be independent based on the command. To this end, write
a bunch of similar parseFooCommand methods. These are a bit more
verbose than the previous logic, it is much clearer what is going on
for each. It has also exposed some repetition that can be factored out
elsewhere, e.g. into RevisionParser.

Change-Id: I37f5ade85af554c8d2682ee02065f683ebfb9345
3 files changed