Fix layout engine issues.

Layout engine will not stop iterating after each component is
satisfied with offered space. Existing algorithm leaded to situation that offered dimensions were smaller than given one, which in some cases like horizontal labels resulted with strange layout (empty space).
Iterative algorithm will finish only after 5 iterations or if there is
no space left.

Category axis while determining if it fits within offered space, checked only text. `Width/Height` is not just dimensions of the text, but also marks and padding.

Close #936, #1207.
The setter to true after this._useLastCalculatedLayout() is used seems very counter-intuitive.

Thinking about the case where _useLastCalculatedLayout is true, you essentially use the _calculatedLayout and then redundantly set the relevant variable to true even though you know it's true