Generalized versions and P011

This now supports adding new TDB versions without any code update and automatically chooses the latest version by default.