Somewhat fixed code style to PEP-8 and fixed duplicate thread results.

Fixed code style of the file and fixed duplicate thread results when using bhotu's 4chan thread search feature.

Needs testing and code style review.