Internalized sim_core thread management.

Task @T21:R : Altered sim_core to have a protected thread object
which is used to run and manage the run_sim() worker thread. Previously
it returned a thread object from start_sim(), raising the risk the
thread object and the sim_core scope would get out of sync.