Implement external reference lookup and caching.

TODO:

- [x] wait for #95 
- [x] wait for #39 
- [x] research caching options:
    - [x] ~~https://docs.python.org/3.4/library/linecache.html~~ (this doesn't provide access to multiple lines)
    - [x] ~~http://pythonhosted.org/pyfscache/~~ (this is for memoization only)
    - [x] https://code.google.com/p/pyficache/
- [x] implement caching option
- [x] always expect `text` on an item
- [x] publish text before the `ref`
- [x] ~~implement approach from #39~~ (moved to #135)
- [x] clean up new TODOs