Turn thread stacks list into proper HTML

From one big <pre> block.