Moving some retrieval code to background scripts (init only)

Future work to come.