add use-as-library option, text-format

allows you to specify own text format functions (eg. red, bold, etc.)