factored out common vertex/fragment shader require.js plugin code