cleanups in p2p.js - "use strict" & document globals