Issue 597: Export database as JSON

This is a behavior change, why do you need this?