formatter: moved db API to sqlalchemy

Unfortunately there are no tests for bibformat_dblayer, so cant check if that is correct