Optimized Solution algorithm

Delayed on inside-out function application until the end of the solution
algorithm. This drastically sped it up! So now we are not getting any stack
overflows anymore and the test is kind of running in reasonable time. This also
had the effect of getting rid of the duplicate f-structures in the solution, but
that simply allows me to longer ignore the problem of not comparing f-structures
for equality as I really should.