Use resolve when possible for module loading

Fixes #31.

I can write a test for this but the implementation is super simple now.