General improvements

The command dictionary in snip.py is being
constructed automatically using the globals()
method of Python.

Added some error checking and general improvements
to robustness.