Confluent Monadic String-Rewriting Systems and Automatic Structures