Test the reindexing task.

As a result, fix a couple of bugs around expecting optional arguments to
be defined, and manually exiting the Rake process instead of raising an
exception.