tests: move Term tests to better file.
Fix Term.MODE setting under Python 3 in case of incapable tty stdout.