Support stdin in output_helper, Add test_nim