several pwx fixes / improvements

given the trainingstagebuch upload discussion I've taken a more thorough look at the pwx import/export and found some gotchas.

Each commit compiles and is tested. Uploads to Traininingpeaks work.