Fixed repository tests
Fixed library tests
Rewritten mocks with mockery
Merge pull request #262 from stefk/tests-fixing

Tests fixing