Updated layout handling according to new Ampersand\HTML API