Pass io.Writer instead of path to PNG generator

Increase abstraction of output for reference PNG graph generator so it
can be used both from the reference CLI to generate files and from the
reference server to directly encode the graph in an HTTP response rather
than writing to a temporary file and then serving it.