Test: Factor T1 to a file in t/lib