Change linked list loops to fast enumeration

Changed some of the internal looping to use the new fast enumeration
where applicable.