Add specs for Rake tasks

Here's my first crack at adding specs for the Rake tasks. I broke it into two layers -- I refactored the task internals into a new module which is tested independently, and I added thin specs for the Rake task definitions.

`rake_tasks_spec.rb` is a little clunky so I'd appreciate any suggestions on DRYing it up. (Of course, that might be better addressed by refactoring the code under test.)