Refactor grid search out of onebird.py