all: Use begin(X) and end(X) rather than X.begin() and X.end()

This is a C++11 feature. There are 2 X.rbegin() occurrences that can't be replaced yet because rbegin(X) is a C++14 feature.