Initialise gon at every page request, because the materials scripts assumes its presence.
Make all the route names singular.
Check for whether we have folders before running the rest of the materials script, because it is loaded on every page.
Fix uploading files to folders.