Fix #49. Start look up with the file dir.
Clean up global vars.
Merge pull request #50 from busykai/fix-49

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