Adding sell/buy value history, trends computation and some refactoring.