Issue 597: Export database as JSON

This is because sometimes a whole section (for example apgar) will be missing if all of its parameters (apgar1, apgar5) are not present.