A helper function to resolve a module name or path in relation to the specified context and require it.