several changes to flashcard.js using database information and collection of analytic data