Fixed typo of occurrences + tidying up the outliner
Refactored prettyprint quite a bit. Code is readable, output is not really pretty because it spans multiple lines (see next commit)
Refactoring of prettyprint, 'the unreadable commit'. Output code now _really_ is pretty, but code is horrible.