Issue 597: Export database as JSON.
Fixed backwards compatibility issue.