Fixed issues where 'head' or 'tail' was called on an empty list
Added a failure test and modified .gitignore to allow test files to be versioned