Ability to track files used to compile a template

I'm working on a piece of middleware that will dynamically compile jade templates to static html and invalidate that html whenever any file used in the compiling the template changes (i.e. extends and includes). Sort of what stylus is for css for jade/html. (wip: https://github.com/sdether/jaded)

In order to do the cache invalidation, i need to know what files make up a compiled template. Since compile only returns a function, I've attached the tree of files i recursively gathered in the parser to the function as a property, which may not be the most elegant way. If you'd prefer I create a new API entry-point that returns an object containing both the compiled function and the file tree, let me know and I'll re-work this.