add support for CubicVR 3D engine, minor optimizations/updates