Change aggregation to use Medium instead of id
removed make_relative
push labels into to_json (not tested)
Add labels test case
Merge branch 'feature_query_rewrite' into feature_query_rewrite_datatable

Conflicts:
	amcat/tools/tests/aggregate.py
Fixed labels test, term labels