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