Bugfixes and enhancements to text fields

A couple of bugfix commits for text fields, then some features. The features are to support some of Safari's extended attributes.