Refactor UI test APIs

Refactored the UI test APIs:

- The UI APIs are used for creating users/groups/collabdocs/...
- Any JavaScript errors in the UI will be logged by CasperJS now, potentially giving more information about failing tests
- Exchange of information between UI and CasperJS happening through events
- More robust waiting for resources to get created
I think calling an internal OAE UI API can be simplified quite a bit. For example:

** util.js **

```
/**
 * Catch remote callbacks and execute an event when the callback data has a callback ID
 *
 * @param  {Object}    data    Data sent back from within the callback
 */
casper.on('remote.callback', function(data) {
	if (data && data.cbId) {
    	casper.emit(data.cbId + '.finished', data);
    }
});

/**
 * TODO
 */
var callInternalAPI = function(api, apiFunction, params, callback) {
	var rndString = testUtil().generateId();

	// Bind the event called when the internal API has finished
    casper.on(rndString + '.finished', function(data) {
        return callback(data.err, data.data);
    });

    casper.evaluate(function(rndString, rndString, api, apiFunction, params) {
    	// Add the internal callback function
    	params.push(function(err, data) {
            window.callPhantom({
                'cbId': rndString,
                'err': err
                'data': data,
            });
        });
        require('oae.api.' + api)[apiFunction].apply(this, params);
    }, rndString, api, apiFunction, params);
}
```

** content.js **

```
/**
 * Create a new collaborative document
 *
 * @param  {String}       displayName         Display title for the created collaborative document
 * @param  {String}       [description]       The collaborative document's description
 * @param  {String}       [visibility]        The collaborative document's visibility. This can be public, loggedin or private
 * @param  {String[]}     [managers]          Array of user/group ids that should be added as managers to the collaborative document
 * @param  {String[]}     [viewers]           Array of user/group ids that should be added as viewers to the collaborative document
 * @param  {Function}     [callback]          Standard callback function
 * @param  {Object}       [callback.err]      Error object containing error code and error message
 * @param  {Content}      [callback.content]  Content object representing the created collaborative document
 */
var createCollabDoc = function(displayName, description, visibility, managers, viewers, callback) {
	testUtil().callInternalAPI('content', 'createCollabDoc', [displayName, description, visibility, managers, viewers], function(err, data) {
		if (err) {
			casper.echo('Could not create a collaborative document: ' + err, 'ERROR');
			return callback(err);
		} else {
			return callback(err, data);
		}
	});
};
```