CBlockLocator improvements & move to core

This moves the chain-related logic in CBlockLocator to CChain (CBlockLocator is a P2P data structure, its implementation shouldn't depend on validation engine globals), and then moves CBlockLocator itself from main.h to core.h.

This means construction of CBlockLocator objects now happens in O(log nHeight) instead of O(nHeight), as it can use CChain's height-based index.

Depends on #3077.