server: Hash entire path, not just query

Fixes a collision if two requests had the same query parameters,
but different graphs. This would then serve a cached image to the
second request.
server: Support outputting non-PNG formats, add test for JPEG

Can now use /graph/foo.jpg, where .jpg specifies output file format
Defaults to PNG if not specified, like before