Added an ability to dump the db to json. Note: this is experimental, and there's a lot of headache that needs addressing before this is entirely useful.