Put OpenGL and GLFW initialisation in function.  Removed unnecessary function to get random shape.