functional tests: Fixed sql testcase runnability detection and reworked testcase counting

Functional tests now able to count success and failures.
Some minor refactors for better naming.
Added exception handling and printing for testcases (setUp and tearDown, too).
Testcase now can be skipped, if not eligible for running.