Added query history (saving and loading)