added guards to _.first and _.rest and tests, they now work as function parameters to _.map
(cherry picked from commit 2afcffb30a69d1a6f41f90a9214199f1c45a2516)