Add util for getting terminal size (and a unit test)