Add option to specify class loader for static resources

This adds the ability to specify a specific class loader in which to resolve static resources. The main use case for this is to isolate public resources from internal ones.
Instead of using `if-not` here, you could just use `if`.