Move file IO tools into the lib directory and export a function.
Give readdoc an API more similar to Julias read* functions.