Split code into modules for core, mysql and psql