Changed iterators to use auto, many of which using range-based loops

Well, I think you got the point :)