Fix test.py.

It may detect the need-screen-escape incorrectly or not invoke the vim
subprocess in the first test case.  These could be fixed by adding a
short sleep.
Code cleanup for test.py.
Solves waiting problem in an elegant way.

1. The keys after launching vim will wait until the vim is full loaded.
2. The keys after leaving vim will wait until the vim process is dead.
3. A bunch of cleanups.
Fix tmux interface.
Add docstrings for TempFileManager.
Now test.py check the version or tmux.

Version 1.8 also works.
Ahbong is contributer now.
Merge pull request #340 from cwahbong/test-fix

Never rely on waiting for Vim to finish something, instead make it write a file.