Replace use of $stdin.gets with UI.gets

Removes the need to re-assign $stdin during tests.