[WIP] Remove mysql_* functions

- [x] Install and configure Doctrine DBAL
- [x] Inject Doctrine into LegacyController
- [] Update all uses of mysql_* functions to use doctrine