Positioning computations moved to Class.layout to allow testing