Basic BWT implementation using iterators.