Added update_cycle_time

Added update_cycle_time that updates average and adds to element latest
cycle and average cycle times.
Implemented unit tests.
Refactored testElement to stateElement.