Separated analytics logic from the web interface

Getting ready for redis!
Live streaming of pcap