move datalogging stuff from activity into intentservice

compiles but probably doesn't work yet