Structural, electronic, and magnetic properties of iron carbide Fe7C3 phases from first-principles theory