Move indexing and DB initialization to Rake, groundwork for testing.
Add specs, return errors.