Switch from SQLite to PostgreSQL
Reimplement text splitting and optimise mcd generation