Adds a setup script, unit tests, and fixes a bug with "read" stats.