LUCENE-5392: A raft of rewrite.

Some specific writing to correspond to LUCENE-5388. Some cleanup from the long ago. So busy-body-blue-pencilling.