Fix unclosed string literal when replacing quotes for a string ending in backslash
Add test for replacing quotes for a string ending in backslash
Refactor code to make it more readable
Extract constants