Fix Alt+[0-9] buffer access order

WeeChat sends them in no particular order, we need to sort the buffers by
their WeeChat number. To avoid copying the potentially very large buffer
objects around needlessly, extract the relevant keys and sort, then access.

This is based on https://github.com/ailin-nemui/glowing-bear/commit/ad50220bfdfcf029fc47093ce5cfea04bf90fe79
Merge pull request #431 from glowing-bear/fix-buffer-ordering

Fix Alt+[0-9] buffer access order
Split things up into logical blocks
Karma: Include files in the right order

glowing-bear.js needs to be loaded before the modules building upon it
Merge pull request #430 from glowing-bear/refactor

[WIP] Refactor Glowing Bear
When closing the window, disconnect instead of asking the user to do it
Ask confirmation before closing if user has unsent input
Merge pull request #432 from glowing-bear/disconnect-when-closing

When closing the window, disconnect instead of asking the user to do it
Create dark theme by extracting theme settings from glowingbear.css

* Remove style.css as those values should be themable as well.
* Update urls in index.html to link to dark theme by default
Provide a way to change the theme in the settings

* Selected theme is dynamically loaded
* Preferred theme is stored in the settings.
* Default theme = dark
Add light theme
light-theme: darken most colors by 50% and add it to theme manager
fixup font-family and font-size setting glitches

Replace fontSize placeholder by default value. Placeholders should be used
as suggestions, not effective values.

Remove spurious default value for fontFamily (it is defined right below)
Provide a way to change the theme in the settings

* Selected theme is dynamically loaded
* Preferred theme is stored in the settings.
* Default theme = dark
Merge pull request #433 from glowing-bear/fix-font-size-glitch

fixup font-family and font-size setting glitches
Merge remote-tracking branch 'origin/theme-manager' into teddy-theme

Conflicts:
	js/glowingbear.js
Merge remote-tracking branch 'origin/design-light-theme' into teddy-theme

Conflicts:
	js/glowingbear.js
embedded content: check if scrollIntoViewIfNeeded vendor method is available
Correct setId placement

The setId had been implemented once on the protocol instance and once
as a (unused) static method.
Make it easier to switch protocols

This commit introduces a new module to switch the protocol. It will
look at a protocol=xxx query parameter (like the debug mode) to do so