Convert ChangeTriplet to @AutoValue

Instead of throwing an exception when parsing fails, use Optional.

Change-Id: I124eb2717ae625c6a0cbd4739ae0600236cfc11d
Support change~branch~id in query syntax

It is odd that we describe this in the REST API as a canonical way of
referring to a change, but don't support it in the query syntax. Since
the query parser is also used by the /r handler, this fixes that there
as well.

Unlike in the ChangesCollection parser, allow prefix searches for the
id portion, to be consistent with other search operators.

Change-Id: I55e1cc33caf907cb0ff17dae7a81a46156b6f562