In this new implementation, everything is loaded on a separate thread,
but the textures are initialized on the main OpenGL thread.
This is all to work around the fact that you cannot create a separate
GL context in GLUT.
Loading currently doesn't happen, because loading tries to do some GL
actions which cannot happen in a background thread (in GLUT anyway).
TODO: move all GL options to the main thread, and leave the rest of the
loading to the background.
As a side-effet, now the ordering of the layers is left-to-right rather
than right-to-left. This shouldn't matter in normal processing, but it
is interesting nonetheless.