stdlib/lists: More efficient implementation + more explicit test