Better handling of wrapping menu

Use JavaScript to give the container element a "wrapped" class
and each item that ends up not on the first line a "wrapped" class.
This cleans up the styles considerably.

Always show the drop-down box at the bottom of the header.

Addresses #918