Rework cursor and implement .toArray() and .count()