Add multi-db support from Megatest v2.0