GTNPORTAL-3400 - Added encodeIfNotEncoded

- Added a new method on the HTMLEntityEncoder, to encode an input only
if it's not encoded already.
- Changed the UIPortalApplication.gtmpl to use the new
encodeIfNotEncoded method, as this is a place that can receive both
encoded (like in the Dashboard's title) and non-encoded (like in a
page's title) content.
GTNPORTAL-3416 UI error message instead of HTTP400 when trying to
impersonate twice
GTNPORTAL-3401 Encoding of '&' characters in URLs
GTNPORTAL-3406 Avoid the use of custom attributes for portal navigation portlets
GTNPORTAL-3407 Avoid ID elements starting with number
GTNPORTAL-3409 Use of legacy html attributes not compliant
GTNPORTAL-3411 Minor markup XHTML issues
GTNPORTAL-3412 HTML5 data-* attributes not compatible with XHTML 1.0
GTNPORTAL-3418 Improve Redirect Admin UI to be W3C compliant
GTNPORTAL-3422 Avoid use of class attribute on script elements on head
GTNPORTAL-3425 Error UI in Page Editor with PBR+Richfaces app
GTNPORTAL-3426 - Revert change to the CDI extension processor