Sidebar is categorized per relative directory
This is a bit of an experiment to make the sidebar more useful. It now
doesn't sort by mimetype, but per directory.
This is a hack right now, as it basically just chops up some input data
here and there and changes the painting for the categories to a more
plain look.