add mining history storage

refactored store classes, created generic BaseStore class