Bunch of cleanups

- Use the egg-info providing function on
  archives and directories instead of having
  to find the name and version manually.
- Style cleanups.
- Remove dir/file before after context manager.
- Use the tracewriter so files/directories created
  get automatically deleted on uninstall/remove.

Change-Id: Ib6208cf1e83a34ac49fb1384f8f80b6e71879aff