The Luminosity-Metallicity Relation, Effective Yields, and Metal Loss in Spiral and Irregular Galaxies