Split off unit-tests from the main module

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>