Adding dynamic redirects. Fix for #793

Fix for #793 

*Do not merge this yet!!!!*

This change removes all static binding redirects in app.config, and introduces dynamic redirects in core. The way this is done is by listening to the AssemblyResolve event on the AppDomain, and loading / returning the assembly to redirect to. It turns out using this technique you can swap on the fly and give a different assembly than what was requested.

At startup, it builds a map in map in memory based on the assemblies that scriptcs ships with ensuring that any requests for the same names will be redirected to it's version. It also ensures that any packages in the scriptcs packages folder take precedence over what the script pack / packages assemblies were actually compiled against.

Assembly black magic at its finest....

It appears to work so far :-)

This does not fix the Service Stack script pack issue, as there appears to be no magical fix for that other than updating the script pack. However, I was able to get the old Web Api script pack to work with the latest Web Api (see comments)


I'm wondering if creation of `AppDomainAssemblyResolver` belongs inside `ScriptServicesBuilder`. It seems `ScriptServicesBuilder` has fairly clear semantics currently, i.e. its purpose is to build an instance of `ScriptServices`. With this change it also has the side effect of introducing assembly resolution hooks which sit outside the `ScriptServices` it produces.

I feel that this is something which should sit outside `ScriptServicesBuilder`, probably at the `Program` level. Indeed it is an entry point assembly concern since it is replacing the static binding redirects, even if the type doing the work is defined in `Core` for reuse.

An added bonus would be that `Program` can instantiate `AppDomainAssemblyResolver` in a `using` block to ensure deregistration of the event, although since this is something that should live for lifetime of the process I think this disposal is really just for completeness and won't make any observable difference.