Cleaned up device, made better functions for setting shader params for the webgl device