Refactored shader compiling/linking code.