This is what we have upstream for the dti script, we are halfway rebuilding them to be more uniform, but that gives some groundwork to start on at least.

http://pastebin.com/LAdKQpM4