Feature/offline analytics

rebased to the best of my ability. This version, keeps an offline stack record  of a fixed sized length. When the stack overflows, its bottom recs are deleted and a lost records accumulator is updated. On signal recovery, all events and lost record tracks are uploaded to ga and the local storage is cleared and starts from scratch.

I intend to write some tests at some point as there is quite a bit of functionality there!
A note to remember changing the values for the record_limits. That is low for testing purposes. Needs a higher value!