Moved model index loading into its own function.

This prevents a bug when using large apps with bungiesearch calls in multiple modules.