Simplify some code.

Calling insert() on a range instead of explicitly looping. It just
makes the code a little simpler for a human to read.
New function utils::set_split()

This is a wrapper for split() that translates the return value into
a set. Some places where this can simplify the code where updated.