cmd: Original version of cmd.py from Python 3.4
cmd: Customize to work with MicroPython.