[core, layouts] Move TwoWayView to the layouts library