minor code cleanups, plus necessary tweaks to make the server work with the latest electricsheep client