Improve resource path registration

We cannot rely upon $IP to determine path.
Merge pull request #3 from wmde/resourcepath

Improve resource path registration