tracetest cleanups

Mostly, ported tracetests to unit tests and removed useless tests. Also some other cleanup I stumbled upon.

83 additions and 1,488 deletions. \o/