shell: Reduce usage of global variables and magic numbers
shell: Use signal handlers for SIGINT and SIGTERM
shell: Add listen mode

In listen mode the call, dispatch and enumerate commands can be send
via TCP/IP. The commands and their output have the same format as on the
commandline. The only exception is that commands with multiple output
values have them seperated by \t instead of \n. This should makes them
easier to handle.