Brought previewer.py to PEP-8, and reduced the complexity significantly.

Most changes should be self explanatory. Got rid of those pesky nested if statements.