A man has admitted killing four young children in a kindergarten in Uganda, in an attack that has shocked the nation.