SCAL-306: reorganized test files, fixed some tests (to conform new code) and fixed some detected bugs
Merge remote-tracking branch 'origin/master'