Improve the shader control flow

This gets rid of the weird non-value-returning control path.
Factor shader loading and location finding into a class.
Merge remote-tracking branch 'hawksley/devices'
Merge pull request #5 from amluto/master

Shader cleanup