[Android] Refine the code and case of make_apk_test.

1. Reorganize the test cases for different mode option.
2. Add test case for checking the scenario without '--mode' option.
3. Add RunCommand function to reduce the code duplication.
4. Move the static function together.
[Applications][Tizen] Add a tool to add/remove an application to the App DB

Tizen has a custom way to register/unregister applications into its
application registry, some of the steps need to run as system
administrator, so we separate the steps that need super user access
into a small binary that will be called by the core Crosswalk.

A small amount of effort is made to at least test-compile this tool on
Linux Desktop, to make it easier to detect that some Chromium API has
changed.
[Runtime] Fix application extension registration issue

ISSUE: https://crosswalk-project.org/jira/browse/XWALK-691

When launched as an external web browser, the application extension instance
will be created and trigger "CHECK(application)" assertion failure if
xwalk.app.* APIs are called.

To fix this, now we only create the application extensions after check whether
we have a currently running application in ApplicationService.
Merge pull request #1360 from seanlong/master

[Runtime] Fix application extension registration issue
Merge pull request #1347 from vcgomes/tizen-install-tool

[Application][Tizen] Add a tool to add applications to the Tizen application database
Merge pull request #1352 from junmin-zhu/withoutmode

[Android] Refine the code and case of make_apk_test.
[Runtime] Implement 'onInstalled' event API.

'onInstalled' event is sent to main page,
1. when the application is first installed.
2. when the application is updated to a new version.
https://crosswalk-project.org/jira/browse/XWALK-723

The PR implements the 'onInstalled' API for the first use case.
Use case 2 isn't implemented at present due to Crosswalk application
update is not supported yet.
[Runtime] Add browsertest for onInstalled event API.