Fix to getSGPBaselineConfig to work with gaps in grade progression.

length(.years)-2 was previous .baseline.max.order :: i.e.
.baseline.max.order <- length(.years)-2, but that now allows for the
sgp.percentiles.baseline.max.order argument and takes the min.