Added state handling, and basic OpenGL rendering