Release 3.1.0 -- 16- and 31-bit grayscale, and a lossy-grayscale fix

IF YOU USE LOSSY GRAYSCALE, UPGRADE. 3.0.0 and earlier wrote 8-bit grayscale
files at quality >= 1 that the reference implementation misread by roughly 34
grey levels, roughly uniformly. One wrong per-format flag: the quantization
constant's step at quality 4 belongs to formats that subsample chroma, and
grayscale has a single channel. Mean error at quality 4 falls from 34.05 to 1.24.
Lossless grayscale and all other formats were unaffected; lossy grayscale files
already written should be re-encoded.

Adds 16-bit grayscale (mode 10) and 31-bit grayscale (mode 18, which is bpp 32
with usedBitsPerChannel 31), taking the codec to fourteen formats. Both return
native samples rather than being reduced to 8 bits. 31-bit content needing 32
bit-planes is refused, the plane-count field holding only five bits and the
reference breaking rather than erroring there.

Verified against the reference as a black box: 60/60 and 60/60 at quality 0,
120/120 each way lossy, 400/400 coefficient-exact, and the twelve existing
formats unaffected. 544 tests. Specification 1.8.