Started clean up and making paths a bit more reliable.
Implemented correct (as far as I can tell) encoding of TDS paths