[Android] Support permissions for Java external extensions

Following changes are made:
1. merged external extensions permissions to Android manifest file
2. added a unit test about this feature
3. fixed empty extension_name issue caused by redundant separators

BUG=https://crosswalk-project.org/jira/browse/XWALK-160
[Android] Add the test case about getVersion.

This patch contains the test about getVersion in shared and
embedded mode. It's for the runtime client.
Get the version, confirm it's validity by regular expression.
Remove dependency between XWalkManifestReader and XWalkView.

XWalkManifestReader is in org.xwalk.runtime package, it's on higher
layer than XWalk core, and XWalkManifestReader should not be awared
by XWalk core. So remove the XWalkManifestReader reference from the
XWalkView class.

BUG=https://crosswalk-project.org/jira/browse/XWALK-149
[Android] Only allow to intercept navigation for main frame and subframe

The interception for resource request should be restricted to main frame
and sub frames, so that the page loading state change events, e.g.
onPageStarted and onPageFinished, are triggered only for main frame and sub
frame instead of each kind of resources.

BUG=https://crosswalk-project.org/jira/browse/XWALK-306
[Android][Tizen][SysApps] Change the sysapps API namespace for device capabilities

Change the sysapps API namespace from navigator.* to xwalk.experimental.*
[Mac] Fix the build

[chromium-style] Complex class/struct needs an explicit out-of-line destructor.
[chromium-style] Classes that are ref-counted should have explicit destructors that are declared protected or private.
[chromium-style] Overriding method must have "virtual" keyword.
[Runtime Model] Save system events into sqlite database.

From [1], System events are events sent by the system, a system event
can wake up a terminated application. If user want a system event has
the capability to wake up, then he/she should add listener to that event
in the main document, listener added in other document won’t have such
capability.

To implement this, system events information that registered in the main
document should be saved into system database during installation time.
Whenever a system event comes to event router, the router will check
whether the event is supported by the specified application. If yes,
router will dispatch the event to application, for example, launches a
terminated application and executing onLaunch callback.

This PR is the SQLite implementation to save system event information
into database. It creates a table named 'registered_events' in Crosswalk
application datbase file('applications.db'). The table contains two
columns for each item, (id, event_names). It also provides
some Getter and Setter functions to read/write/remove item(s) from the
database.

Reference:
[1] https://docs.google.com/document/d/1cDb54Cs1wjbNQPb7W44_4aj1bzPI9dqsb2aRDkZmDTE/edit?pli=1#heading=h.v1w5rrn37icm
Merge pull request #1164 from poussa/mac-compile-10

[Mac] Fix the build
Remove the V8 patch. XDK has now its own repository and branch.

We prefer to not have such patches in Crosswalk upstream and would
like to see it coming from Chromium upstream at the next rebase.
Merge pull request #1090 from shaochangbin/system-event

[Runtime Model] Introduce sqlite table to save system events.
Merge pull request #1168 from darktears/remove-v8

Remove the V8 patch. XDK has now its own repository and branch.
Remove the patcher script and its dependencies.

We don't need it anymore as the V8 patch for the XDK has been removed.
We can revert this patch if one day in the future we need that.
Merge pull request #1170 from darktears/removal-patcher

Remove the patcher script and its dependencies.
[Extensions] Add an ExtensionServer to the UI Thread

Currently for the in-process extensions, there is a separated thread
for running the extensions. This patch adds an ExtensionServer to the
existing UI Thread, which will allow extensions that interacts with
the UI or are limited because of main loop integration to run on the main
thread.
[Extensions] Make it possible to query an ExtensionServer for an extension

This function will be used to decide on which thread the extension has
to be created.
[Extensions] Route messages to the appropriated server

Based on the extension name and the extension ID, we route the messages
to the appropriated ExtensionServer running on the Extension thread or the
UI thread.

On the in-process extensions, 2 messages that are normally directed to the
ExtensionServer on the Extension Process are now completely handled by the
filter. One example is the GetExtensions message that has to combine a list
of available extensions from two different servers in a single reply.
[Extensions] Run external extensions on the UI Thread when extension process is disabled

When the extension process is disabled, external extensions will run on the UI
thread of the browser process by default. This is done because external
extensions are expected to run in the main thread of the process it is running.
[Extensions] Run tests on the UI Thread by default

But keep hooks for running tests on the Extension Thread if need. Extensions
requiring IO main loop will need that.
[Extensions] Add browser tests for in-process extension threads

This test verifies if extensions registered to the UI Thread are
indeed running on the UI Thread. The same applies for extensions
registered to the Extension Thread.

We also test if messages (sync and async) are working on both scenarios.
Fix build on Mac by handling the return value of SQLite calls.

Handle the return value and print a message error if the request failed.