More refactoring; handle width and padding better; move the scaling to the main svg element.