Use boost::format instead of ostringstream when possible.
Replace hex and other string modifiers to use boost::format when possible.