Add queryhash and queryq/queryhashq template variables for helping to derive a uniq filename from a request, independent of time.
Add *i file template variables for including the "index" as needed regardless of position in the template string.
Add dirname template variable and rework shelve.getDocumentFilename for efficiency and clarity.
Rewrite getDocumentFilename for simplicity and efficiency
Add dirnameshorten template variable which expands to the dirname with each path component, if longer than MAXNAMELEN, shortened to have a unique hash appended and be at MAXNAMELEN in length. Directory creation should never fail now.
Add archivefilename which generates a filename for archival purposes. The filename is shortened, if necessary, to include the hash of the filename, queryhashq, and extension.