Print stack trace when unexpected error occurs

I alphabetized the imports and added `traceback` so that I could see more detail when an error occurs.