Unittest fixes

Refactor of code. Version of extractor. Moved code into differ-common.