Add appstate sync api

This implementation is based on the app2app api, it is only client-side running
in the browser or wrt.

In order for the api to recognize when there are properties to sync it needs to
know about those properties. Either a template object with existing
properties is used when creating the sync object or for a new prop added later
to a sync obj it is needed to call watch on for them first, so they can be
synced.

Jira-issue: WP-235
Call errorCallback in case a search is already ongoing in app2app.

Jira-issue: WP-719
Catch exception in case api module couldn't be loaded

Fixes startup of PZP/PZH in case of faulty api module config. It logs the
error but continues starting up.

Jira-issue: WP-647
New readJson test for multiple connections

Jira-issue: WP-720
Merge pull request #440 from aldafu/WP-719-errorcallback-when-search-in-progress

Call errorCallback in case a search is already ongoing in app2app.
Merge pull request #443 from aldafu/WP-720-readJson-multiple-connections-test

New readJson test for multiple connections
Merge pull request #442 from aldafu/WP-647-continue-startup-despite-module-require-fail

Catch exception in case api module couldn't be loaded
Fix complains on openssl nm introduced by openssl_init call

Jira Issue: WP-716
Merge pull request #444 from ziransun/cert_crash

Fix complains on openssl nm introduced by openssl_init call
Improve jasmine api tests

Remove all of the self defined matchers like toHaveProp, toBeFunction,
etc. and use the ones provided by jamsine. Don't run findServices for
each spec, instead do it once for the main suite and use that one for all
specs.

Jira-issue: WP-725
Add grunt.bat

On Windows this fixes the need to call grunt.cmd. Instead of trying to
execute the grunt.js file as if it were an executable it will now
execute the batch instead which calls grunt.

Jira-issue: WP-202
Merge pull request #448 from aldafu/WP-202-add-grunt.bat

Add grunt.bat
Merge pull request #446 from aldafu/WP-725-improve-jasmine-tests

Improve jasmine api tests
Merge pull request #441 from aldafu/WP-235-add-appstate-sync-api

Add appstate sync api