Support docID in getLayerSVG (fixes #58)

This is based of the jp/bounds branch.