Moved display functions to a separate module.
Added some documentation. Tidying up a little bit too.