New iterator API.

Replaced cursors with [const_]iter.
Added a val attribute to all iterators.

Using unions to have a read-only attribute for the value.
Replaced loops with iterators.

Particularly those with removals.