Prime tangles and composite knots