Refactored entity.c with extreme prejudice.

Also renamed simClock --> sim_clock_t, according to the usual style of
naming types in C.