Restructured TS map computation

As close to final as it could get today.
In the future please make extra branches and PRs for extra things ... makes it easier and quicker to review and get in.