move perl KSN code to a module and created driver programs.