The Role of Internal Waves in the Layering of Outflows from Semi-Enclosed Seas