#808 Template library optimizations

Cut the number of calls to find_files() nearly in half for most pages on
my site and improved the performance of find_files() itself slightly
(some sites with unusual configurations, i.e. multiple theme paths, may
see a more significant improvement)