Breaking up index.js into core modules