Port TraceBasedSim.cpp to Python.

Porting TBS over to Python in prep for the Multithreaded TBS.