Add a permission field to JSON RPC notation.

This permission is a boolean and flags if the service is allowed by Policy. It is passed to the above service layer from the JSON RPC layer.

Issue WP-684
Changed design: Implementation with handleResponse.

Jira issue: WP-684
Merge pull request #2 from gguowei/wp-684

Modification on handleResponse
Refactor RPC handleMessage function

Refactor to be more readable.

Jira-issue: WP-684
Add test for callback obj onSecurityError handling

Test if SecurityError response for RPC callback object causes
onSecurityError to be called. Used by ServiceDiscovery.

Jira-issue: WP-684