Hooks3

Removed all to_text() (and related) methods.
Created a system to add hooks to events (so far only 'routing_completed' exists).
Implemented a PrettyPrinter hook that hooks into 'routing_completed'.
Changed commands to use PrettyPrinter.