fix some bad includes.

start removing the cfopen function.
move a function that was only used in textstore.c.