Fix GCC errors and warnings that VC++ accepts without a peep:-)
Also hoist value_type, iterator, and const_iterator into derived class for sets, and apply the code cleanup the hoisting enables. Make formatting more uniform.