Major improvements

Impedance is now measured at the sample rate specified, instead of
running continuously in the background regardless of sample rate.

Dynamic calibration resistance array to compensate for errors in
frequency sweeps and different frequencies.

Some variables have been renamed for better clarification.

Modified some library functions. Will communicate changes to group.
Made more readable

Improved code readability, and added more comments.