Add more to flush, fix open functions

Things left to do:

- More flush edge cases
  - Overwriting first block
  - Writing anything other than first block
- Write file entry on closeStream