Analytical representations for simple and composite polytropes and their moments of inertia