MT#7543 First version of API tools.

Needs refactoring to put common stuff into one place, and source it
from there.