add multiple database support via json config instead of flags. Closes #1