Neaten debug tracebacks; and promote colour_text to tools module.