Core/connection: First attempt at a proper threaded, prioritised queue for connection.write().

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit 74fb1b701e8b7d6e8246c4cab4b1c826758d36ac)
Core/actions: Calculate and use priority based on user status, message length and a custom modifier,

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit 26bbea43dabe7f646b8d035dc9cfb7f5e3ef1a5a)
Core/actions: Add priorities to privmsg, notice, reply, alert, invite and kick

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit 65e8c3062d53d05d3838175508f6cc082d422943)
Core/actions: Catch errors in get_pnick during connection.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit 8bbccfb99e7ddd2d418801740ef52b7adb6c9b0d)
Core/connection: Clean up thread on disconnect.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit e30bb5c6523b5b95944bba4b8a108ac0107ab994)
Core/connection: Increase the antiflood period for low priority messages.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit 2755f11ddf705f39fc7785b0ef0ceeed6d64dfce)
Core/admintools: New module for adminmsg() function. Broadcasts a message to all (online) admins listed in merlin.cfg.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit 08ff412484ad5e9506552c80d6b734a63cf3d2d2)
Core/connection: Warn admins on excessive message queue length/delay.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit a4f00b1a839cf19eee3b00dc9291ffc322c29f74)
Core/connection: Move warning parameters to merlin.cfg.

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit d2d45ae474c5869aa530fd75d4ee3cb1f59211de)
Core/admintools: Move imports into the function declaration to enable use in Core/connection.py

Signed-off-by: Martin Stone <martin@d7415.co.uk>
(cherry picked from commit 98367ed7dbef5c981fe6268c389a9a5465a21f60)
Core/actions: Change priority to use is_admin() function.

Signed-off-by: Martin Stone <martin@d7415.co.uk>