pass recorded folder as environment variable to cgi script
factor out list_files function
use algorithm max_element to find largest shared substring for query string possible matches