Rewrite deleteFirstBy() to use foldl() instead of explicit assignments in a foreach().
Tests for methods deleteBy(), and deleteFirstBy().