Tidied up data file handling and buffers.

Decided against attempting a proper implementation at this point. It
works very well as it is, and there are other elements of the design
that need reworking too. Not currently a priority.
Removed page size as it's no longer an issue.
Fixed the stdin handling and tests.
Tidied high level code and improved test coverage.