Added first test and implementation of tail function.
Added new tests for tail functions