Cleanups:
* Remove BOOST_FOREACH and use C++11 range-for
* Leverage auto for iterators and loop control variables
* Fix shadowing iterator declaration