Double Quote escaping and a new test (example)

This may not be the end-all in security (should review for XSS and other vulnerabilities) , but for now, it does keep data from cutting out of the value attribute in an input tag.