refactored test code into spec foldr, added Rakefile, rake test