Uniform way to communicate to and from WebView and Javascript