Download Fit fixed

For some reason Download Fit stopped working. The root cause is a bit unclear but I restructured the code, removed use of deprecated functions and did some other cleanup. Now it works again.