implement Cursor.stream(). Refactored into multiple files