Refactor random data generation

Add new RandomDataProvider object and implement existing random number
generation in terms of that.  This enables end users to supply their
own random data providers.
Allow OS-provided secure random to be disabled
Retarget 5.1.0 changes to 5.2.0
Comments about incremental update support

Also remove some trivial, non-functional code.
TODO note on pluggable filters