AtomType_Pair is an oxymoron! :)
"Atom" is not a good synonym for "value"; it is a kind of value.
"Atom" is not a good synonym for "value"; it is a kind of value.
What strikes me is that Atom's are being copied by value all over the place, even when a good chunk of them don't matter. I don't know whether the optimizer can help with that or not, but it seems like there could be a lot of unnecessary copying during procedure calls and returns.