add cleanup script for state jsons
improve deletenode.py script
use sortkeys for cleanupstates