Added statistics collection to Solver. It works fine although not finished yet.