C++: Add FormatReader implementation

This adds the main FormatReader implementation (detail/FormatReader) and associated helper classes.

Note that a couple of bits of functionality are missing since the bits they depend on are not yet available. These are marked with `@todo` in the sources.

Some of the FormatReader/FormatHandler interface logic wasn't quite correct, and this has been fixed in this PR.  Primarily constness and type fixes.