consensus lib work: Reduce boost dependencies

These are the functional changes needed to remove boost as a dependency from the upcoming consensus lib.

After these changes, a good bit of code movement is still needed to actually remove the dependencies, but it's little more than copy/paste. Those will come as a 2nd PR after this one to ease review.

Please pay special attention to the new serializers in walletdb.cpp. I believe I've ported that correctly, but I'd like to have lots of eyes on it.
Coding style nit: can you put a space after the 'for'?