Add max distance to search and ignore certain globals

- Specify maximum distance when constructing the ObjectGraph
- We need to ignore hooked variables like $FILENAME, because evaluating
  hooked variables can have side effects