Updated and enabled early loop detector

Updated early loop detector:
 * Fixed segfault
 * s/ibefore/iafter/g
 * Removed the code of later loop detector
 * Solver was been rewritten