Multi-instance support

Only works in the GUI for now, doesn't break  the command-line client but the new options are not implemented.

Related to #29 
Aha! Feel free to drop `// TODO:` and `// XXX:` comments in for hacks. That way we know they're not supposed to stick around. :) 

(I'm totally happy to merge code with TODO/XXX, it means we know something needs to happen, and we can find it later.)