Refactor and add tests for store.
Added history in store.
Limit history to 30 values.