Improved file_to_string code

Fixed file_to_string, now finds file size, allocates buffer at once, and then reads file to string buffer. Review and pull if satisfactory !