added toText, etc;
merge stephen with test, toText, etc.
many major changes;