Optical modelling of resonantly absorbing multilayers: Implications for leaf iridescence and lamellar chloroplasts