Add MixtureValueScorer::validate methods to check array sizes

This breaks Loom, which is currently sloppy with its cache validity assumptions.
Merge this branch as soon as Loom cleans itself up.