Refactor startup checks onto a separate function.
Split the logic to check if a block file can be opened to a separate function.
Add undo data to checks to be sure all required info can be opened.
Scan active chain instead of map of blocks.
Recognize and accept pruned blocks when loading the database.
Add a switch to allow running in a pruned state.

These are the main functional changes on this state:

* Do not allow running with a wallet or txindex.
* Check for data at startup is mandatory only up to the last 288 blocks.
* NODE_NETWORK flag is unset.
* Requests for pruned blocks from other peers is answered with "notfound" and they are disconnected, not to stall their IBD.
Add a counter to log the range of pruned blocks.
Implement autoprune.

This mode introduces a configuration parameter to keep block files at less than a fixed amount of MiB.
Merge branch 'autoprune' into testing

Conflicts:
	src/init.cpp
	src/main.cpp