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

I'm not sure if with this one you can necessarily assume there will only be a single result