Implemented characteristics backend.

Currently the new algorithm is quite slow, it eventually should use
shared_ptrs or raw objects. More cleanup and some temporary tcp code for
future twitch API.