Use resolve when possible for module loading

Fixes #31.