Add tests for list_tohead and list_totail.