Respect database prefix

Allow Moodle to supply the database prefix, instead of assuming mdl_.