Use <g> to simplify SVG and fix styling. Make functions clickable etc.

Place each rect and text pair into a g block.
Replace the duplicated rect and text onmouseover with a single g onmouseover.
This reduces the size of the SVG file. It also fixes the loss of the black border when mousing over the text.

An external file can be used to specify attributes for individual functions. So, for example, functions can now be given links.

(They can't be given specific colors via this mechanism, at least not currently, because the colour of the <g> is overridden by the colour of the <rect>. YAGNI applies for now.)