Fix layout engine issues.

Right now, layout engine will not stop iterating after everybody is
satisfied. Termination will occur only after 5 iterations or there are
no space left. This apporach fixes issue with compotent, which can be
wrapped.

Category axis didn't took into account offered width/hight when checking
if it fits.

Close #936, #1207.
can you explain why removing this is appropriate? looks like now even if every component does not want width it will continue to iterate in this loop and will only stop when freeWidth === 0 or it can't improve on the freeWidth? this seems like an OK change to me (i dont see how it would produce bugs) but it isn't totally syncing up with your PR description for me.