Assorted preparations for removing textbox duplication during line splitting

cc. @pcwalton