Fixes up the AST operator evaluation functions.

They needed to be more careful with type safety, in order to properly support informing the caller when an expression is dependent on an ininstantiated template type.

Enumerations will need some doctoring to get them to work correctly with this; they will then need a runtime touchup upon template instantiation.

As such, my next task is to fix up the duplicate() and remap() functions to actually work correctly. They are crucial for proper template instantiation, which is what I'm actually going for this time around.