Use stdlib json

Some flake8 changes and DEPENDS tidyup
Fix a mistake in tm finished alert