Added flatMap to SolutionTree and refined Frontier

Plus increased test coverage of the TreeFiniteDomainSolver.
Bug fixes

There was a problem in TreeFiniteDomainSolver.findNodeUnder and in the
Monoid implementations of Frontier.