termutils: moved imports to top of function.

There is no need to invoke import more than once.
termutils: made environment query assume a default

If the terminal size cannot be determine by any of the 3 methods used in this
function, assume the default size for a terminal of (24 x 80).

The last block of code had an undeclared variable 'env', so if this block had
been executed it would not have worked.

Changed to using 'if cr is None' to conform with PEP8,

http://www.python.org/dev/peps/pep-0008/
termutils: open file using with

Using with ensures that if and exception is thrown the file will be closed.
termutils: added LinuxTerminalSize class

Added a class with functions for the different methods of querying the window
size. This made is easier to test each of the implementations.

I have moved the import statements out of the querying function; there is really
no siginificant benefit to lazy importing.

Introduced the contextlib package to cleanly open and close the controlling
terminal process in order to query its size.
termutils: imported sys module
termutils: fixed typo in LinuxTerminalSize