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 
Oh my goodness, *such* magic numbers. I honestly have no idea what they mean at all.

- [ ] Document magic numbers.