runtime: Share more code between Vulkan and EGL
The Vulkan and EGL JSON manifests are more similar than they are different, so let's handle them through the same code (which I already factored out into smaller functions).
Based on !195 (merged), !196 (merged). /cc @denittis