Rewrote page title extraction in tabbing.js

Fixes https://trac.vikingco.com/ticket/15169.