[Tizen][Runtime] Fix can not update application.

In the old logic, when we update an application, we
uninstall the old application and install new application,
but when we call
     <pkgmgr_parser_parse_manifest_for_installation>
and  <pkgmgr_parser_parse_manifest_for_uninstallation>
on one process, this process will crash.So we should use
     <pkgmgr_parser_parse_manifest_for_upgrade>
to update.

And we should make a new pkg start point for new app data.

BUG=XWALK-1738
[Tizen][Runtime] Reconstruct some code on pkg helper.

When update have similar work way, I make some shared function.

And I also make some change on uninstall, so that we can see
the step of uninstall clearly.
[Android] Add test case for canGoBack().

This patch is to add test case for canGoBack().
Before load any url, canGoBack should be false.
Load the first url, canGoBack should be false.
Load the second url, canGoBack should be true.
[Android] Add test case for getAPIVersion().

This patch is to add test case for getAPIVersion().
Verify the api version with regular expression.
Merge pull request #2001 from jinbang/test_api_canGoBack

[Android] Add test case for canGoBack().
Merge pull request #1963 from wuhengzhi/getAPIVersion_test

[Android] Add test case for getAPIVersion().
Merge pull request #1976 from CooderIan/fix_app_update

[Tizen][Runtime] Fix can not update application.
[Runtime] Add collapse white space for widget attr.

According to
http://www.w3.org/TR/widgets/#rule-for-getting-a-single-attribute-value

We need to replace any sequences of space characters with a
single U+0020 SPACE character, then we need to remove any
leading or trailing U+0020 SPACE characters from value.
[Runtime] Add IRI items validate for widget.

According to
http://www.w3.org/TR/widgets/#iri-attribute
http://www.w3.org/TR/widgets/#table-of-elements-and-their-attributes

The id and authorHref are IRI item, and we need validate and trim
white space for they, and if they are illegal they will be empty.
[Runtime] Fix wrong write of variable name on js.

Fix it.