Move cleanup into teardown, delete obsolete code.

cc @senny