Cells now correctly open and close channels according to needs and environment.
Moved testing code to main.py.