Add environment() method to TreeToIndex.

Fix up some docs.
Make LINE and FILE singular so they match their contents.