Why are funeral directors called undertakers?

Funeral directors go by many names. Undertakers is one of them, they are also commonly called morticians.