Source code reorganization

Extract backend loading from core.