combined some source into content.js and poll.js for easier sharing of code