Added opening a new tab on double click on tab background (ref #305).
Rearranged global functions in lua spec for simpler grouping (ref #79).