Exercise 3.1: Added pattern matching test.
Exercise 3.2: Implemented the tail function and tests.

I also refactored the test suite using a common "setup trait". This is for reuse
of common objects for the tests.