A Lie Group-Based Race Car Model for Systematic Trajectory Optimization on 3D Tracks