Refactoring app.js, show and hide matches, general modifications