Refactoring singly linked list to make it template. Tidying up test cases.