Define themes using a domain-specific language, inspired by Pygments

This change makes it possible to define different rendering backends for
FlowUI other than ANSI terminals. It also loosens the connection between
themes and terminals somewhat.