Refactored TreeFiniteDomainSolver's search method

Increased test coverage for VariableRankingPolicy and introduced the
toStream method into SolutionTree.