Brought project closer to compliance with PEP-8, made some massive simplifications in previewer.py.

Most changes should be self explanatory. Let me know if you have any questions.