Add functionality to the database specific section.

Make sure that there is support for running scm_prepare_database.sh for
postgresql, mysql, and oracle databases.
Fix $module variable and add module dependencies.