Implement XML/JSON API

This is additional work on #1698.

It aims to fix issues and replace some stuff (I'm really not sure about using Alice, as it proven many time to be hardly limited).
i think a lot of these are phpunit defaults and don't need to be added here. like so: https://github.com/symfony/symfony-standard/commit/324692e840cd5a77897219d9953146884e5a9e60