Refactor to Output and OutputLine classes

To support reformatting that will be needed for one-line objects, refactor to include Output and OutputLine classes.