Adding tty function to test module

Not sure if test is the right module to put it in, since it's a posix command... but it's just a simple little function to write to a tty. Came in handy for me today.