Which class of vertebrates is considered to be the first to develop lungs, allowing them to become terrestrial organisms?