move gl stuff out of main.js