Simple generic linked list class, for functional programming