Fix gap.js to be protocol agnostic