restructuring: valEncode, encodeHTML, jsHint