take: export and add tests for the take function