Restructure data directories, add history.json, fix mth bug in count