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 
I know this is from previous code, and is not a PR stopper, but it wouldbe great to catch particular exceptions here rather than all of them. This runs the risk of silencing unexpected exceptions, which would be a terrible thing to occur.