Scientists have discovered that skin appendages such as scales, feathers and hair evolved from a common ancestor 320 million years ago.