[SPARK-1087] Move python traceback utilities into new traceback_utils.py file.

Also made some cosmetic cleanups.