Feature/add card behavior

Hides the current card view when adding a card and refactored the JS into a separate module.