Wrap bridge.js in a function to keep  from polluting global name space

It is occasionally desired to have a unit test that checks if a library affects variables in the global name space. The existing bridge.js declares a global function `sendMessage` for internal use, which affects such a test and could potentially conflict with an existing function by the same name.

This patch wraps the entire bridge.js in a closure to keep `sendMessage` private.