Simplify List.hasSubsequence by extracting a helper function

... as per Runar and Paul's solution.