The search for jovian and saturnian irregular moons and a study of their luminosity functions