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!
not really, was aiming to get the version working and passing the tests, then  refactor the factory into the service above.