Python3 changes, handle exceptions

* The main routine will catch desired exceptions and print a nicer
  message instead of a complete backtrace.
* Made changes to dictionary merging for Python 3 compatibility.