Added basic threading framework

Threading framework implemented (quick+dirty). Should be enough of a
basis to start implementing the statsd flusher and the mysql poller.
Merge pull request #2 from spil-jasper/master

Added basic threading framework