Removed APPEND_FD_CACHE and cached_open.

- Closes issue #356 (Get rid of cached_open)
- Refactored some file access to 'with' statement
Changed more file code to 'with' statement.

- Fixed leak in streamer.py