looking at the replace chains on s(val) reminded me of something a while back, is there a faster/better way to do this king of stuff? something like:
return s(val).replace(re, function(t){
if( t == '>' ) return '>';
if( t == '<' ) return '<';
if( t == '&' ) return '&';
if( t == '"' ) return '"';
return t;
});