Show a chevron menu button when tab bar overflows

The behavior is based on Safari where last visible tab is swapped with the selected tab, if selected tab itself would not be visible.

Commit edited by Allan Odgaard, original version used document icons in overflow menu and would make the effective last tab sticky.

Closes #1060
Use UTIs for both application and Quicklook generator

UTIs are taken from both the Apple supplied list and newly created for those that didn't exist. For those languages where no clear 'owner' existed to provide the reverse-DNS notation we use a com.macromates.* stand-in.
Avoid using NULL_STR with scope_t::push_scope
Use std::make_shared
Remove unused operation queue type
Implement Check Spelling

Now using Edit -> Spelling -> Check Spelling selects next spelling error or one
at caret if it was not yet selected, then shows context menu with correction
suggestions.

This makes checking spelling as easy as tapping Cmd+;

Closes #1103
Add Show Next for quick spelling iteration

Also add key equivalents to spell popup menu.
Reduce text overlap when showing context menu
Invalidate spelling when ignoring or learning a word

We invalidate the entire buffer since the word can appear in multiple locations. This could be optimized to only invalidate misspelled instances of the ignored or learned word. Likewise, we redraw entire buffer since the refresh macro is not able to handle changes in spelling meta data and calculate minimal refresh region.
Only show suggestions when Check Spelling is called via menu item

Otherwise just select next spelling error on Check Spelling, which is called by
spelling panel as well.
Remove Text → Transpose Words

This is unimplemented and I probably won’t implement it unless there is a very compelling use-case.

The Text → Transpose action can already transpose words, either when separated by whitespace, comma, etc., or when the words are selected as two (or more) discontinuous selections.

Closes #1109
Enable text view’s context menu actions
Update spelling panel and use when visible
Use local variable for document->buffer()
Enable “Check Spelling as You Type” in checkSpelling:

This is required so that we have the proper meta data (misspelling ranges).
Synchronize spelling panel and buffer languages

If the spelling panel is visible when checkSpelling: is invoked then its language is taken and used for the buffer. If the panel is not visible, the buffer’s language is set for the spelling panel.

We probably should also set the spelling panel’s language when switching document, and when the panel is first opened. I don’t think the code complexity is really worth it though (depends on how often one use the spelling panel with a non-default language).

Fixes #1104
Use specialized menu for Check Spelling

We only show “Find Next” (previously “Show Next”) when context menu is shown as a result of “Check Spelling” and we leave out the other actions.
Implement NSChangeSpelling and NSIgnoreMisspelledWords
Fix update of misspelled ranges

If nothing was misspelled in the updated range, and a value existed for the end of the range (indicating that what followed the updated range was misspelled) then that value would be erased.
Protect grammar_t with mutex

Presently buffer_t::wait_for_repair will use the grammar from the main thread (rather than wait for the parse thread to finish) which does cause a race condition since the parser will now mutate the grammar (graph coloring).

Ideally buffer_t::wait_for_repeat would simply wait for the parser to finish, but I’d prefer to first switch the parser to use GCD.