Fix issue #630 - Warnings for Content Elements and Modules.

Editing and creation of Content Elements and Modules was causing
warnings.
Extract database in class MetaModel into property.
Refactoring: reduce complexity of MetaModel::saveItem().
Change implementation of is*Attribute to use instanceof.
Extract conversion of database result into result set into own subroutine.
Drop check for legacy name of simple attribute.
Extract fetching of translated values into own method.
Extract filtering for retriveing attribute of type into own method.
Refactor unserializing into own method.
New method MetaModel::getAttributeByNames().
Inject database into MetaModel rather than pulling it.
Refactor Driver::fetchAll() to reduce complexity.
Extract sorting determination into subroutine.
Extract language switching into extra subroutine.
Further reduce cyclomatic complexity in class Driver.
New method MetaModel::buildDatabaseParameterList();
Use new method MetaModel::buildDatabaseParameterList().
Add missing parameter to MetaModel::fetchTranslatedAttributeValues().
Add fake db unit-tests and add some tests.
Remove superfluous line breaks.