Doctrine Conversion

This PR is ready, but testing would be appreciated. otherwise I'll merge it and testing can commence after that :wink: