unique() now a generator which preserves order

Since unique() is passed into filter() it’s safe to make it an
iterator. Also it let us save some memory.