Save a topology to a file.

def save_to_file(cn_topo, filename):
    '''
    Save a topology to a file.
    '''
    jstr = cn_topo.serialize()
    with open(filename, 'w') as outfile:
        outfile.write(jstr)