Fix spatialite query

For all dbqueries apart from 5 (sql file for each person), the select
query referred to an alias that didn't work (a.utctimestamp as time).

Changed occurances of 'time' to 'a.utctimestamp'

This time I hope I didn't mess the formatting up.
Merge pull request #2 from belasco/bugs/spatialite-query-fix

Fix spatialite query
More clean-ups
Fix warnings