Started code clean and split up.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
Don't rely on weechat-* requiring 's it before it's needed

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>