Improved flatfile read and write performance. Fixes #76.