added TeX support
added cmd-exists[]
lotsa cleanups