Add Javascript profiles support.

Add support to preload javascript libraries. This feature can be used to load common libraries like JQuery or custom libraries defined by the user.