Change queue handling to use glib.h

Code does build, but isn't tested yet.

TODO:
- Check what is missing/ wrong (mem management, threads, ...)
- VSYNC