ui: make ui_output() take a formatted string

- minor cleanup in logging
- use ui_output() for interactive output
- avoid using re_printf()
- stdio: added an output_handler (to stderr)