Use codecs.open to read text in get_tex_root and makePDF
Use codecs.open and extra safety logic in latex_ref_completions