In your script file make sure you define require.config with a correct basepath pointing to the server.
If you already have require on the page then I guess that could cause trouble loading via the data-main attribute, try placing a reference to your code in a script tag after the require script tag, won't load async but it's something to try to isolate the problem at least
You can check out how I do it here
I set a different context for my own stuff. The only issue I've run into is if I try to get an object with an extension within my code, which has the custom context. This may not even be a problem for you, but you could get around it I'm pretty certain by just registering any extensions you may be using in the default context.