Move try/except/print out of functions.

Shellac suppresses exceptions. For debugging (and production?) we want
to see them. Make a decorator which explicitly prints exceptions.

Later we can make this depend on a debugging flag.
Better printexceptions decorator.
Raise an exception if fetching the schema failed.
Tidy and PEP8.
Refactor list commands editor.
Close temporary file earlier.