added ajax to aside container to update stats, refactored and fixed tests