Consolidate compilation conditionals around types

Normally, I'd do this with an extension methods. But this is good
enough. Conditional compilation makes things harder to read so when we
can intelligently combine them, it's helpful.