Add list helpers for head and tail length N
solve problem 18, and revamp 17 to use list helpers