VID-1976 adding some unit tests
VID-1976 adding more unit tests and slightly refactoring code
Merge branch 'VID-1976' into VID-1976-unit-tests
Merge branch 'VID-1976' into VID-1976-unit-tests
VID-1976 fixing after upstream merge
VID-1976 code cleaunup
VID-1976 adding another test
Merge pull request #4849 from Wikia/VID-1976-unit-tests

Vid 1976 unit tests