WIP: add detection functions to machotools.