Merge pull request #4 from vhordejcuk/master

New thread model introduced
Refactoring, many fixes