Restructured TS map computation

As close to final as it could get today.
Can you please remove this TODO list and instead make a new Github issue listing things you still think should be done or investigated?