Extracted database communication to Database.js

Furthermore fixed little bug with createOrUpdateTranslation.