Code Cleanup

Did some code cleanup, implemented a buffer for limiting RS485
transmits events, filtering of ADC inputs.