Prune dead code, cleanup

Add options for dry-run mode