add support for GPX files and improve code; switch to Python3