Compute the correct bearing and removes several debug print outputs.
This commit contains a lot of basic fixes (basic string stuff, that couldn't be tested without a working server before) and adds debug messages.
Added basic functionality