compiler: Memoize GetType() on TExpr

This massively reduces the time to generate intermediate code on large Orly source files.

Thanks Joris (@jmlvanre) for finding / coming up with this (And initial patch). This changes the implementation pattern of that patch, but does the same thing.

This implements the same thing as #240 but does it in a little bit cleaner / simpler way. We put all the caching logic in one place (TExpr's `GetType`), and move the calcuation of type to `GetTypeImpl`