Fix bug for modal not closing on page change
Turn animations into directives and some debug changes