Minor update in GL version detection
Turned some functions into library functions