Refactored into GlDoublePendulumApp class.