FACES-1894 Add general utilities for Liferay Faces Alloy Components (Simplified and cleaned up encodeJavaScriptMain. In the JavaScript, replaced creation of variables and checking for null with an anonymous self-executing function.)