Bugfix: to_json on vocabularies now works as expected, regression tests added.