Remove c++ 11 cbegin and cend

Fix compiler errors/warnings for non c++ 11 compilers.