Fix IPython in opengl_test.py, code cleanup