function decode(description) {
    var pagination = {
      elements: { canvas: {}, tabs: [] },
      offsetStart: 0,
      offsetEnd: 0
    };

    var i, char, currentWidth = 0, midTab = false;

    // Initialize our tabs and offsets
    for (i = 0; i < description.length; i++) {
      char = description.charAt(i);

      switch (char) {
        case '-':
          currentWidth += TAB_WIDTH;
          pagination.elements.tabs.push({ offsetWidth: TAB_WIDTH });
          break;
        case '.':
          currentWidth += (TAB_WIDTH / 2);

          // If we're in the middle of a tab and we see another half; go ahead and add a full tab.
          if (midTab) {
            pagination.elements.tabs.push({ offsetWidth: TAB_WIDTH });
            midTab = false;
          } else {
            midTab = true;
          }
          break;
        case '[': pagination.offsetStart = currentWidth;
          break;
        case ']': pagination.offsetEnd = currentWidth;
          break;
        default:
          throw new Error("Unrecognized char for decode(): '" + char + "'");
      }
    }

    // Initialize our canvas element
    pagination.elements.canvas.clientWidth = pagination.offsetEnd - pagination.offsetStart;

    return pagination;
  }
Decode the requested pagination description and return a config object containing the canvas
and tab elements, along with the start/end offset.

The width of every tab is defined by the TAB_WIDTH constant at the top of this file.

@param description {string} A string representing the pagination object. Each character
represents a portion of the tabs as follows:

    `-` - The dash, or hyphen, represents a single tab of length TAB_WIDTH.
    `.` - A period represents a tab that is half-visible. It is partially hidden by the
          pagination wrapping. If used, you MUST have an even number of periods, and you MUST
          only separate them with pagination characters (i.e. don't put a tab inside a half
          tab).
    `[` - The beginning of the pagination.
    `]` - The end of the pagination.

All descriptions MUST contain a series of dashes and/or dots representing tabs, as well as a
single beginning and ending tag for the pagination.

Examples:

    '[-----.].----'

This example has 5 visible tabs; 1 tab that is half-visible, half-hidden; and 4 visible tabs.
The pagination starts at 0 and ends at 5.5 * TAB_WIDTH.

    '---[---]---'

This example has 3 hidden tabs; 3 visible tabs; and then 3 more hidden tabs. The pagination
starts at 3 * TAB_WIDTH and ends at 6 * TAB_WIDTH.

@returns {{elements: {canvas: {}, tabs: Array}, offsetStart: number, offsetEnd: number}}