sets: use opApply in foreach loops instead of extracting elements

Signed-off-by: Peter Williams <pwil3058@gmail.com>
lexan: simplify the interface for creating a new LexicalAnalyser

Signed-off-by: Peter Williams <pwil3058@gmail.com>