Axis.Category._requestSpace caches character sizes

# cat-cache
![cat-cash-1](https://cloud.githubusercontent.com/assets/3344958/3379540/75d128fc-fbf3-11e3-8b79-6f9f3f44b7eb.jpg)

`catAxis._requestedSpace` decides how to fit ticks into their bounding boxes by inserting them into the DOM and then measuring them, letter-by-letter. This means a hundred or so touches to the DOM each time you call `_requestedSpace`, which makes it rather slow.

This branch changes `_requestedSpace` to measure and cache the dimensions of each character, and compute their sizes by adding up individual characters. This means you only touch the DOM as many times as you have letters, and caching means that further resizes will be much faster.

Adding up individual characters is only an approximation, but it's fairly accurate, always within `0.05` px of the actual measurement in my tests.

### Before (page load)

![screen shot 2014-06-24 at 4 23 19 pm](https://cloud.githubusercontent.com/assets/3344958/3379726/a177812e-fbf6-11e3-866f-8f2db5c03d7a.png)

### After (page load)
![screen shot 2014-06-24 at 4 22 06 pm](https://cloud.githubusercontent.com/assets/3344958/3379729/b3ca9366-fbf6-11e3-9394-ea941dc7377b.png)

### Before (resize)
![screen shot 2014-06-24 at 4 30 12 pm](https://cloud.githubusercontent.com/assets/3344958/3379790/d37ee3c8-fbf7-11e3-9af2-c6d76e4f0366.png)

### After (resize)
![screen shot 2014-06-24 at 4 29 40 pm](https://cloud.githubusercontent.com/assets/3344958/3379789/d07a9000-fbf7-11e3-982a-36ba20c94f6b.png)


Close #572.
In regards to merging this duplicated function with `writeText`, I don't think it's going to be possible without making the code more complex. We'd need quite a few if statements and a really long function function signature. It'd look something like

```
function measure(text: string, width: number, height: number, horizontally: boolean,
               textMeasure?: Text.TexMeasurer,
               g?: D3.Selection, xAlign?: string, yAlign?: string) {
      var orientHorizontally = (horizontally != null) ? horizontally : width * 1.1 > height;
      var primaryDimension = orientHorizontally ? width : height;
      var secondaryDimension = orientHorizontally ? height : width;
      if (g != null) {
        var innerG = g.append("g").classed("writeText-inner-g", true);
        textMeasure = getTextMeasure(innerG);
      }
      var wrappedText = Util.WordWrap.breakTextToFitRect(text, primaryDimension, secondaryDimension, textMeasure);
      var usedWidth: number, usedHeight: number;
      if (g == null) {
        var widthFn = orientHorizontally ? d3.max : d3.sum;
        var heightFn = orientHorizontally ? d3.sum : d3.max;
        usedWidth = widthFn(wrappedText.lines, (line: string) => textMeasure(line)[0]);
        usedHeight = heightFn(wrappedText.lines, (line: string) => textMeasure(line)[1]);
      } else {
        var wTF = orientHorizontally ? writeTextHorizontally : writeTextVertically;
        var wh = wTF(wrappedText.lines, innerG, width, height, xAlign, yAlign);
        var usedWidth = wh[0];
        var usedHeight = wh[1];
      }
      return {
        textFits: wrappedText.textFits,
        usedWidth: usedWidth,
        usedHeight: usedHeight
      };
 }
```

I don't think that's very clear what's going on, it seems like a lot of weirdness to avoid copying about 5 lines of duplicated code.