Made razor compilation more robust

- Support other kinds of references when compiling razor views
- Cache application references since they can't change throughout the lifetime
of the running application

/cc @pranavkm 
Could you add a comment saying this is taken verbatim from https://github.com/aspnet/KRuntime/blob/dev/src/Microsoft.Framework.Runtime.Roslyn/RoslynCompiler.cs#L164?