semi-working reading of files. going to implement writing soon.

exposed bugs in library.