improvements to jui, use nonblocking i/o in stdout thread