Moving functions into the main loop

Moved most of the functions in the interrupt into the main loop. Rather than having all the buffering and conditional operations in the interrupt, the interrupt now only increments the loop/sample timers and reads from either the ADC or delaybuffer (depending on what flag is set). The checks for the read state are now done in the main loop.

Also, so early efforts have been made to start using c for more basic functions. The ins and outs are now set in C using the DDR registers rather than in arduino code.