Added code for statistics and other minor changes

Added functions for calculating statistics from stored history. Call
back.getStats() returns a two dimensional array containing percentages.
Changes in front/main.js so that backend's getAnswer is called only
once. I made sure to pass the provided answer to the backend as well for
proper functionality.