Properly compute the type of a Const in a selector expression.

Closes #1068
Fix a bunch of failed tests.
Make some intentions not have state.

Hopefully fixes #849 for good.
Removing useless file
Reenable expression type caching