I've redone the main thread view so that it displays properly. The problem was that the dotted lines which I was using to show the relationship between posts (idea copied from the Windows Explorer, but for some reason I always thought it looked cool, if somewhat useless) weren't being displayed right. In the end I used an array/stack (in Perl they're the same thing, since arrays can be grown dynamically by simply accessing an out-of-bounds index, and there's already push and pop functions built-in) to store the lines which needed to be displayed. In any case, it looks pretty now.
Oh, and I've decided to move on to other things, instead of extending sonar. Not quite sure what, but it'll come to me.