Gpu device selection

Makes it possible to set gpu device selection vars programmatically, and have them depend on user_context.

probably worth documenting the expected lifespans of get/set char* input arguments (e.g.: the input argument to set will be copied; the return value of get should be treated as valid only until next call to set... or whatever the actual constraints are)