Move symbol work to sept fn
Create QGIS layer tree
rejigger arguments

use positional for input, default to stdout
Use more up-to-date v of QGIS
Be finicky about gc
hacky way to prefix document with <!doctype>