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

I'm not exactly sure how I'd go about it on this one.