Added utils.logger for IO logging.
Added logging.
made teststr construction less error prone.