Extract state -> feature_vector transform to an analyzer.

I'm not introducing an inheritance hierarchy at the moment because I'm not
convinced that there will ever be another analyzer for the parser, but we
can always add it later if we find it useful.