Add -dryrun flag for testing, improve the behavior of 'rebuild'