Switch to a real set, migrate map functionality to separate module

Signed-off-by: Eli Skeggs <eskeggs@globesherpa.com>