use fail instead of raise
use tidy executable in $PATH if available