LSD: Lyman-break galaxies Stellar populations and Dynamics - I. Mass, metallicity and gas at z ∼ 3.1