Clean up detect module a bit
Add tev-detect command line tool