moved database initialisation into Global
Created Dog model class, dogsController and dogsRepository. Refactored all usages