library finally builds. the error and reading functions are all complete (though untested).