Unit tests infrastructure and Travis-CI integration

There are 2 commits in this PR:
* 11f88c4 - this has basic unit testing infrastructure plus tests for the parts I need to change for my use-case
* a955d6c - integration with Travis-CI

On of the guys having admin rights to this repo will have to activate Travis hook when this things get merged