jsterm-911456: Bring remoting styles together

Create a thin shim ‘protocol.js’ to allow us to use similar code for
remoting GCLI on the web and in Firefox.
This means we take the raw functions in ‘remoted.js’ and encapsulate
them in an object which also simplifies how things work.

Signed-off-by: Joe Walker <jwalker@mozilla.com>