Refactor common functionality in the TwoSided factors to AbstractTwoSidedFactor.java
Add the evaluation method to the interface and abstract implementations of factors
Extract comparator & entry interface from the BestKValues utility