Ensure that #version is always first in shaders

Some shader compilers require #version to appear first (even before
any #defines) and will give an error otherwise.