Slightly improve test.tostring (add quotes around strings).
Add support for backreferences.