Issue 597: Export database as JSON

Yes.

But only for the moment, the other exports should use the controllers as well in the future.