[WIP] WebGL and misc memory optimizations