Be smarter about checking file locations

Fixes #128.
Merge pull request #129 from david-christiansen/ipkg-load

Be smarter about checking file locations