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
Merge pull request #441 from aldafu/WP-235-add-appstate-sync-api

Add appstate sync api