[core] Refactor and test --tool lint, deps, fmt