Added multi-instance support to command-line client