Cache compiled PagesHashStrategy classes
Generate calls on Type class instead of on concrete subclasses

The generated code may not be able to reference type classes by name if
they are on a different classloader (e.g., plugins)