Refactored the flexbox step to determine available space in main and cross dim
Refactored the flexbox step to determine available space in main and cross dim

Summary: Refactored the logic to calculate available main and cross dimensions

Reviewed By: emilsjolander

Differential Revision: D6693777

fbshipit-source-id: d6c87670e74bdc22b32916c2d77fe423d831b378

facebook/yoga,facebook/yoga,facebook/css-layout,facebook/yoga,facebook/yoga,facebook/css-layout,facebook/yoga,facebook/css-layout,facebook/css-layout,facebook/yoga,facebook/css-layout,facebook/css-layout,facebook/yoga,facebook/css-layout,facebook/css-layout,facebook/css-layout,facebook/yoga,facebook/yoga,facebook/yoga