Move caching of compilation results to its own layer.

This will allow only creating the razor compilation when really needed, with the right lifetime.

Without this change, the ICompilerService might be resolved with a disposed scoped service provider.