Save and restore sys filehandles before reload(sys). FIxues issues #43 and #21 possibly.
Use LINES and COLUMNS environment variables if we can't get it from stty.
Small grammar typo in comment
Move assignment of std_handles out of try loop so that if this fails we don't try an erroneous restore.
Merge pull request #46 from solvebio/feature/ipython-notebook-and-issues-21-43

Address issue #43 and possibly #21