Fixed a number of typos and bugs, updated test file.
Added (nonfunctional) test read file.