Clean up systems and move util functions.

Removed weird quadratic function.
Added exponential function.

Moved local_avg and find stable points to util.py.