Pep8 & detection of deletions

1) Refactored defrag so everything is more nicely wrapped in functions. 
2) Conform more to Pep8 (indentation using spaces instead of tabs)
3) Deletions should also be detected in windowed_test.  This was ambiguously previously.