TMS support 

Tests in tms.txt (see also for documentation), all tests pass