Finish moving core data structures into core.h.

This pull request is the completion of #2154.

The original intention was to also move CBlock into core.h but was postponed in the interest of merging what had already been done.