majorly refactor sequencefile code

- reuse a buffer for reading in the file, to save on memory
- return io.EOF at the end of the file, instead of nil for a record
- pass records by value instead of by reference
write indexes to disk using leveldb

For small datasets, the performance is unlikely to suffer significantly, since
the index will show up in the buffer cache anyway. For larger datasets, memory
usage using a simple map can really explode, and this prevents that.
major code reorganization (into subpackages)