Added Altitude support and cleaned some code.

Remved the debug activity and added altitude to the database
Added altitude, check for existing batch

Renamed kind column names
Added altitude
Check for existing batch and session to prevent write overheads