Added flag to signal that a request to stop calibration has already been sent.
Consting argument.
Partially rewrote scheduling mechanism to fix a design flaw.
Using stacks now instead of queues.