toaplan2: fix compile, also slightly cleanup/reorganize toaplan2.h (nw)