stringify() for flag values.

This patch adds a stringify member function to the Flag structure which
lets us iterate and fetch flag values. During flag initialization, the
toString methods are closed over the flag value and option references.
Flag values can't be closed over up front as flag values may be changed
by user code arbitrarily. So stringify takes in the owning flags
instance as a FlagsBase pointer: stringify(FlagsBase*).

From: Niklas Nielsen <nik@qni.dk>
Review: https://reviews.apache.org/r/15285
Added flags field in master and slave state.json

This patch adds flags field to master and slave state.json end-points
which expose all configuration flags as additional diagnostics.

Review: https://reviews.apache.org/r/15288