Fix #49. Look up starting with the file directory.

This fixes #49 Start looking up with the directory where the file being inspected is located.

Also some global vars clean up.

@cfjedimaster, please take a look.