LPS-50840 make initEditor a global function
LPS-50840 refactor Js code

Remove all global functions except initEditor and use Js events to wire
everything together.
LPS-50840 set cmd on the server

The value is known in the server and it cannot be changed by the client.
LPS-50840 make Liferay.provide import AUI
LPS-50840 check_sf
LPS-50840 SF