Splitting core.js into controllers and services.