Add exponential moving average and refactor simple moving average logic