bug fixies + some cleaning
- unit test for fixed lock free queue
- fixed mem leaks
fixed #165
fixed review comments
Merge pull request #253 from nem0/multithread_refactor

- fixed lock free queue + unit tests
merged master
compilable after merge