MOVEONLY: Move BaseIndex to its own file.
Summary:
backported fifth commit (2318affd2) from PR13243
https://github.com/bitcoin/bitcoin/commit/2318affd2
Depends on D2936
Test Plan: make check
Reviewers: #bitcoin_abc, deadalnix, Fabien, jasonbcox
Reviewed By: #bitcoin_abc, deadalnix
Maniphest Tasks: T630
Differential Revision: https://reviews.bitcoinabc.org/D2937