added core.js file, separated view logic in a script file, will proceed with refactoring before starting with the unit tests