Updated API to allow outputting of HTML to stderr, for easier piping using gupload etc.