write all cdts tables even if stories do not exist; fix bug in write_gexf that didn't write media codes
delete all existing codes of the code_type; fix check for 'null' codes