factored out "stateful adapter" stuff from gdb adapter

created mozz.adapter.CLIAdapter which may be useful for
some other adapter in the future which is similarly
CLI-oriented like GDB is.