Use poll instead of a backend thread
Remove debug printfs by default
Merge header files