Remove obsolete scripts

These are no longer in use, and some do not work anymore.
Consolidate Perl subroutines