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 and colors.