Convert all SPARQL queries over to JSON results.
Minor refactorings and improvements.
Fix network visualisation code to match new JSON input.