Made the server side code a little more modular. Changed the placement
of the counter incrementation in background.js to only increment once
per update.