Fix module loading for .net5
Sbstracts away the different methods of loading assemblies for netfx4 vs net5.