Large refactor to settings handling

Modularisation of bibliographic database