Molecular control and function of endoreplication in development and physiology