Merge pull request #6 from marekjm/tests

Refactored string manipulation, connecting procedure changed
This is not a good commit. Broken many things.