Main Loops

I changed the way event-handling is done by the server and client from a 'one thread per connection' model to a 'one main thread with a main_loop' model.
This still requires one main thread for the main_loop, but will save us the hassle to spawn one additional thread for each connected client in the server, later on.
kiro-client now also has a connection management event handler. It does nothing yet, but i needed to add a main_loop to it anyways, so... why not.
Also, i changed the threading implementation from pthreads to g_threads. (Fix #2, and also kind of #3) 

With these changes, i can now start to work on #8 and #6