Fix licenses
Memoize terminal colour support detection. No reason not to.
Add constants for some ANSI escape sequences.
Add helper for determining whether terminal supports ANSI colours. This is currently unused, but is intended for future use in error messages.