webadmin: Cross-window communication support for UI plugins

This patch introduces support for cross-window (cross-origin)
communication that can be utilized by UI plugins, i.e. custom
content (contributed by UI plugin) talks back to UI plugin code
via WebAdmin (parent) window.

This enables custom content to pass arbitrary messages back to
given UI plugin(s) which might, or might not, react to them.

The implementation is based on HTML5 window.postMessage API
that triggers 'message' events on the target (i.e. WebAdmin
parent) window. WebAdmin takes care of intercepting such
messages, doing allowed source origin checks, and passing
message data to UI plugins as appropriate.

Sample UI plugin code:

<snip>

    var api = parent.pluginApi('showcase');

    // New function - define custom API options
    api.options({
        // Can be either a string (single origin)
        // or a string array (multiple origins)
        // "*" means "any origin", as per HTML5 spec
        allowedMessageOrigins: 'http://nicedomain:8080'
    });

    api.register({

        UiInit: function() {
            // Assuming dialog content sends message via:
            //   parent.postMessage(message, targetOrigin)
            api.showDialog(...);
        },

        // New event handler function
        MessageReceived: function(data, sourceWindow) {
            // Source origin check already passed here
            window.alert('MessageReceived: ' + data);
        }

    });

    api.ready();

</snip>

Aside from message processing, 'sourceWindow' can be used
to establish two-way communication between custom content
window and UI plugin code.

This patch also includes smaller (general) improvements.

Change-Id: I8a159bed88e0709b54a31f0959fb08b6cdf508cb
Bug-Url: https://bugzilla.redhat.com/895103
Signed-off-by: Vojtech Szocs <vszocs@redhat.com>