Cleaned up config.hpp

* Moved FOREACH to dict, the only class that should use it
* Switched bag_impl's FOREACH to BOOST_FOREACH