To answer your question, I added it in there to do a quick sanity test, to verify the ledgers, as Yuhao and I were unsure if the rippled ledger command was working.

The hardcore mode parses the binary blobs converted from the json, and dumps it back to json, before creating another blob. This was just to exercise the code and uncover any issues (eg. missing field declarations and the Uint64 signedness issue)

I added some comments to the ledger verifier: https://github.com/ripple/ripple-lib/commit/5280d994a219469461b9b815edf88c3767d58421#diff-e54add323eef20afc775a201e9a28788R12

I will add some tests for the ShaMap / ledger verifier at some point. I don't think there's any currently.