Move test db under resources.
Code cleanup.