Initial merge into juju repository

This PR is the initial merge of previous work into the juju/jujusvg repository.
I suggest it's nicer to avoid the float64 round trip by writing the requisite tiny abs function.

func abs(x int) int {
    if x < 0 {
       return -x
    }
    return x
}