Change the way TEXINPUTS gets defined to ensure that the directory containing
the main document file comes before any other dir, to allow documents to have
files that "override" like-named files elsewhere on the search path. Guido
discovered we needed this.