Speed up scanbeam traversal

Scanbeam was a list of unique long kept sorted at each insertion.
Keeping it sorted is a O(n2) process.
This use a set instead where the process is O(nlog(n)).

On a huge model, I saw 10% speedup with this modification.