allow dllexport in vc11
replace boost.foreach with range-for
use emplace_back where appropriate