[TASK] Some code cleanups and refactoring of database reset

Use TRUNCATE table statements for much faster reset of the test database
(MySQL only for now).