Adding cpp function for fast writing to colored bed file