Refactor routes; added core.js.