Pyflakes cleanup

I was poking around the source code to try to get a better understanding of how it all fits together and figured I might as well contribute some of the low hanging fruit.

This fixes Issue 613 (https://github.com/statsmodels/statsmodels/issues/613) for the base module. I fixed some pep8 issues as I went (my commit hook complained!)  Hope you can use it.