Fixed compilation issue on linux. Updated shader mode selection logic (thanks scrawl). Cleaned up a little but needs more once things are settled.