Got rid of cumbersome processing of preamble to find included files.
Now modify TEXINPUTS instead with configuration setting tex_includes.