Implemented take and takeWhile for lists.