Fix encoding of backslashes in arrays

Backslashes were not getting correctly escaped when encoding into arrays.  Any `Seq[String]` put into the database would lose all its backslashes.  This fixes it and updates the tests to catch it.