Quiescence Test and Cleanup

Implemented quiescence test; also did a lot of cleanup, removing many,
many unused variables and functions.