Upgrade head.js, fix tests for production env't