Various fixes to use more C++11 features

As we already use C++11 lambdas, we should also use foreach and std::string.
```auto const &action```?