Bug 1003095 - Refactor protocol.js to be worker friendly;r=past