Make build_lines() PEP-8-compliant so I can stop being distracted while mucking with it.
len(seq) > 0 --> seq
Add a couple comments assuaging and cementing my confusion.
Fix some whitespace in the file template.
Rewrite build_lines so we no longer emit misbalanced tags and to support overlapping and line-spanning regions.

Add support for overlapping regions (not refs, because that would be a UI problem). Preserve the semantics of interleaved refs by translating to an equivalent balanced series of tags. This lets plugins be less coupled with each other: deployers no longer have to worry about which plugins get along with each other: even if we use different tokenizers for a language (as we do with clang and pygments), build_lines will reconcile their token boundaries.

It's also got test coverage now.
Filter out zero-width tag spans.
Get html_lines working. Get first end-to-end test of build_lines working.
Make TagWriters emit unicode, to go with the rest of the output source code.
Simplify tag_boundaries.

There's no need to chain all that stuff together, keeping regions and refs contiguous; we're going to sort it afterward anyway.
Add an explicit sort order for keeping Lines outermost and Refs next outermost.
Make HTMLification of line-spanning tags work. Switch to a slice-based coordinate system.

The slice-based coordinates save code, as it turns out, and make tag balancing easier to get right, as we can just go ahead and yield reopening tags for temporary closers at the same offset as the temp closer. The old indexing scheme didn't like such overlaps of start- and endpoints.

Make html_lines tolerate Lines that aren't outside all the tags on the line. That saves a lot of painful complexity in the tag balancer, all in O(n).
Add annotation support, and integrate the new region resolver back into the rest of the system.

* Make html_lines emit Markup objects.
* Remove an assert that should no longer be forbidden with the slice-based indexing scheme.
* Make annotations come out of the plugins in line order so we can just use merge() on them.
* Stop passing line numbers into the template; it can figure those out itself.
Add more console output during worker pool initializiation.

I had yet another no-CPU hang and want to be able to narrow down the cause next time.
Fix a line_boundaries() crash when there aren't any tags.
Filter out zero-length spans.

They can cause starts to sort after ends, crashing the tag balancer.
Tolerate None start- and endpoints.

Some plugin really still is spitting these out.
Fix an UnboundLocal error for `id` when formatting an exception.
Fix balancing of certain line-spanning tags.

Special-case Lines more vigorously in balance_tags_with_empties().

This removes the side effect that was causing Line tags (and only Line tags) to become misordered in relation to other coincident tags, which we were then making up for in html_lines(). However, that led to a failure to properly close all tags before the end of a line in some cases. Now, balanced_tags_with_empties() encloses each line in properly-balanced Line tags, without_empty_tags() preserves them, and html_lines() uses the line-end tag as impetus to flush its buffer.
Fix a few docstrings.
Rewrite HTML generation to no longer emit misbalanced tags and to support overlapping and line-spanning regions. Close #172.

The new implementation also has test coverage, which the old didn't.