Added the ability to export the domain to JSON.