Some improvements

 * Remove unused struct elements
 * Rename some things
 * Reuse more code
 * Use 512 byte read buffer

See #14.